home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / raytrace / rayshade / doc / guide / objects.tex < prev    next >
LaTeX Document  |  1992-02-09  |  16.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: objects.tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CRLF line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: plain text[CRLF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 4f 62 6a 65 63 74 20 |\chapter|{Object |
|00000010| 44 65 66 69 6e 69 74 69 | 6f 6e 7d 0d 0a 0d 0a 4f |Definiti|on}....O|
|00000020| 62 6a 65 63 74 73 20 69 | 6e 20 7b 5c 72 61 79 73 |bjects i|n {\rays|
|00000030| 68 61 64 65 7d 20 61 72 | 65 20 63 6f 6d 70 6f 73 |hade} ar|e compos|
|00000040| 65 64 20 6f 66 20 72 65 | 6c 61 74 69 76 65 6c 79 |ed of re|latively|
|00000050| 20 73 69 6d 70 6c 65 20 | 7b 5c 65 6d 20 70 72 69 | simple |{\em pri|
|00000060| 6d 69 74 69 76 65 7d 0d | 0a 6f 62 6a 65 63 74 73 |mitive}.|.objects|
|00000070| 2e 20 20 54 68 65 73 65 | 20 70 72 69 6d 69 74 69 |. These| primiti|
|00000080| 76 65 73 20 6d 61 79 20 | 62 65 20 75 73 65 64 20 |ves may |be used |
|00000090| 62 79 20 74 68 65 6d 73 | 65 6c 76 65 73 2c 20 6f |by thems|elves, o|
|000000a0| 72 20 74 68 65 79 0d 0a | 6d 61 79 20 62 65 20 63 |r they..|may be c|
|000000b0| 6f 6d 62 69 6e 65 64 20 | 74 6f 20 66 6f 72 6d 20 |ombined |to form |
|000000c0| 6d 6f 72 65 20 63 6f 6d | 70 6c 65 78 20 6f 62 6a |more com|plex obj|
|000000d0| 65 63 74 73 20 6b 6e 6f | 77 6e 20 61 73 20 7b 5c |ects kno|wn as {\|
|000000e0| 65 6d 20 61 67 67 72 65 | 67 61 74 65 73 7d 2e 0d |em aggre|gates}..|
|000000f0| 0a 41 20 73 70 65 63 69 | 61 6c 20 66 61 6d 69 6c |.A speci|al famil|
|00000100| 79 20 6f 66 20 61 67 67 | 72 65 67 61 74 65 20 6f |y of agg|regate o|
|00000110| 62 6a 65 63 74 73 2c 0d | 0a 7b 5c 65 6d 20 43 6f |bjects,.|.{\em Co|
|00000120| 6e 73 74 72 75 63 74 69 | 76 65 20 53 6f 6c 69 64 |nstructi|ve Solid|
|00000130| 20 47 65 6f 6d 65 74 72 | 79 7d 20 6f 72 20 43 53 | Geometr|y} or CS|
|00000140| 47 0d 0a 6f 62 6a 65 63 | 74 73 2c 20 61 72 65 20 |G..objec|ts, are |
|00000150| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 61 20 |the resu|lt of a |
|00000160| 62 6f 6f 6c 65 61 6e 20 | 6f 70 65 72 61 74 69 6f |boolean |operatio|
|00000170| 6e 73 20 61 70 70 6c 69 | 65 64 20 74 6f 0d 0a 70 |ns appli|ed to..p|
|00000180| 72 69 6d 69 74 69 76 65 | 2c 20 61 67 67 72 65 67 |rimitive|, aggreg|
|00000190| 61 74 65 2c 20 6f 72 20 | 43 53 47 20 6f 62 6a 65 |ate, or |CSG obje|
|000001a0| 63 74 73 2e 0d 0a 0d 0a | 54 68 69 73 20 63 68 61 |cts.....|This cha|
|000001b0| 70 74 65 72 20 64 65 73 | 63 72 69 62 65 73 20 6f |pter des|cribes o|
|000001c0| 62 6a 65 63 74 73 20 66 | 72 6f 6d 20 61 20 73 74 |bjects f|rom a st|
|000001d0| 72 69 63 74 6c 79 20 67 | 65 6f 6d 65 74 72 69 63 |rictly g|eometric|
|000001e0| 20 70 6f 69 6e 74 20 6f | 66 0d 0a 76 69 65 77 2e | point o|f..view.|
|000001f0| 20 20 4c 61 74 65 72 20 | 63 68 61 70 74 65 72 73 | Later |chapters|
|00000200| 20 6f 6e 20 73 75 72 66 | 61 63 65 73 2c 20 74 65 | on surf|aces, te|
|00000210| 78 74 75 72 65 73 2c 20 | 61 6e 64 20 73 68 61 64 |xtures, |and shad|
|00000220| 69 6e 67 20 64 65 73 63 | 72 69 62 65 0d 0a 68 6f |ing desc|ribe..ho|
|00000230| 77 20 6f 62 6a 65 63 74 | 20 61 70 70 65 61 72 61 |w object| appeara|
|00000240| 6e 63 65 73 20 61 72 65 | 20 64 65 66 69 6e 65 64 |nces are| defined|
|00000250| 2e 0d 0a 0d 0a 41 6e 20 | 7b 5c 65 6d 20 69 6e 73 |.....An |{\em ins|
|00000260| 74 61 6e 63 65 7d 20 69 | 73 20 61 6e 20 6f 62 6a |tance} i|s an obj|
|00000270| 65 63 74 20 74 68 61 74 | 20 68 61 73 20 6f 70 74 |ect that| has opt|
|00000280| 69 6f 6e 61 6c 6c 79 20 | 62 65 65 6e 20 74 72 61 |ionally |been tra|
|00000290| 6e 73 66 6f 72 6d 65 64 | 0d 0a 61 6e 64 0d 0a 74 |nsformed|..and..t|
|000002a0| 65 78 74 75 72 65 64 2e | 20 20 54 68 65 79 20 61 |extured.| They a|
|000002b0| 72 65 20 74 68 65 20 65 | 6e 74 69 74 69 65 73 20 |re the e|ntities |
|000002c0| 74 68 61 74 20 61 72 65 | 20 61 63 74 75 61 6c 6c |that are| actuall|
|000002d0| 79 20 72 65 6e 64 65 72 | 65 64 20 62 79 0d 0a 7b |y render|ed by..{|
|000002e0| 5c 72 61 79 73 68 61 64 | 65 7d 3b 20 77 68 65 6e |\rayshad|e}; when|
|000002f0| 20 79 6f 75 20 73 70 65 | 63 69 66 79 20 74 68 61 | you spe|cify tha|
|00000300| 74 2c 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 2c 20 |t, for e|xample, |
|00000310| 61 20 74 65 78 74 75 72 | 65 64 0d 0a 73 70 68 65 |a textur|ed..sphe|
|00000320| 72 65 20 69 73 20 74 6f | 20 62 65 20 72 65 6e 64 |re is to| be rend|
|00000330| 65 72 65 64 2c 20 79 6f | 75 20 61 72 65 20 73 61 |ered, yo|u are sa|
|00000340| 69 64 20 74 6f 20 62 65 | 20 69 6e 73 74 61 6e 74 |id to be| instant|
|00000350| 69 61 74 69 6e 67 0d 0a | 74 68 65 20 74 65 78 74 |iating..|the text|
|00000360| 75 72 65 64 20 73 70 68 | 65 72 65 2e 0d 0a 41 6e |ured sph|ere...An|
|00000370| 20 69 6e 73 74 61 6e 63 | 65 0d 0a 69 73 20 73 70 | instanc|e..is sp|
|00000380| 65 63 69 66 69 65 64 20 | 61 73 20 61 20 70 72 69 |ecified |as a pri|
|00000390| 6d 69 74 69 76 65 2c 20 | 61 67 67 72 65 67 61 74 |mitive, |aggregat|
|000003a0| 65 2c 20 6f 72 20 43 53 | 47 20 6f 62 6a 65 63 74 |e, or CS|G object|
|000003b0| 20 74 68 61 74 0d 0a 69 | 73 20 66 6f 6c 6c 6f 77 | that..i|s follow|
|000003c0| 65 64 20 62 79 20 6f 70 | 74 69 6f 6e 61 6c 20 74 |ed by op|tional t|
|000003d0| 72 61 6e 73 66 6f 72 6d | 61 74 69 6f 6e 20 61 6e |ransform|ation an|
|000003e0| 64 20 74 65 78 74 75 72 | 69 6e 67 20 69 6e 66 6f |d textur|ing info|
|000003f0| 72 6d 61 74 69 6f 6e 2e | 0d 0a 54 72 61 6e 73 66 |rmation.|..Transf|
|00000400| 6f 72 6d 61 74 69 6f 6e | 73 20 61 6e 64 20 74 65 |ormation|s and te|
|00000410| 78 74 75 72 65 73 20 61 | 72 65 20 64 65 73 63 72 |xtures a|re descr|
|00000420| 69 62 65 64 20 69 6e 20 | 43 68 61 70 74 65 72 73 |ibed in |Chapters|
|00000430| 20 37 20 61 6e 64 20 38 | 20 72 65 73 70 65 63 74 | 7 and 8| respect|
|00000440| 69 76 65 6c 79 2e 0d 0a | 0d 0a 5c 73 65 63 74 69 |ively...|..\secti|
|00000450| 6f 6e 7b 54 68 65 20 57 | 6f 72 6c 64 20 4f 62 6a |on{The W|orld Obj|
|00000460| 65 63 74 7d 0d 0a 0d 0a | 57 72 69 74 69 6e 67 20 |ect}....|Writing |
|00000470| 61 20 7b 5c 72 61 79 73 | 68 61 64 65 7d 20 69 6e |a {\rays|hade} in|
|00000480| 70 75 74 20 66 69 6c 65 | 20 69 73 20 70 72 69 6e |put file| is prin|
|00000490| 63 69 70 61 6c 6c 79 0d | 0a 61 20 6d 61 74 74 65 |cipally.|.a matte|
|000004a0| 72 20 6f 66 20 64 65 66 | 69 6e 69 6e 67 20 61 20 |r of def|ining a |
|000004b0| 73 70 65 63 69 61 6c 20 | 61 67 67 72 65 67 61 74 |special |aggregat|
|000004c0| 65 20 6f 62 6a 65 63 74 | 2c 20 74 68 65 20 57 6f |e object|, the Wo|
|000004d0| 72 6c 64 20 6f 62 6a 65 | 63 74 2c 0d 0a 77 68 69 |rld obje|ct,..whi|
|000004e0| 63 68 20 69 73 20 61 20 | 6c 69 73 74 20 6f 66 20 |ch is a |list of |
|000004f0| 74 68 65 20 6f 62 6a 65 | 63 74 73 20 69 6e 20 74 |the obje|cts in t|
|00000500| 68 65 20 73 63 65 6e 65 | 2e 20 20 57 68 65 6e 20 |he scene|. When |
|00000510| 77 72 69 74 69 6e 67 20 | 61 20 7b 5c 72 61 79 73 |writing |a {\rays|
|00000520| 68 61 64 65 7d 0d 0a 69 | 6e 70 75 74 20 66 69 6c |hade}..i|nput fil|
|00000530| 65 2c 20 61 6c 6c 20 6f | 62 6a 65 63 74 73 20 74 |e, all o|bjects t|
|00000540| 68 61 74 20 61 72 65 20 | 69 6e 73 74 61 6e 74 69 |hat are |instanti|
|00000550| 61 74 65 64 20 6f 75 74 | 73 69 64 65 20 6f 66 20 |ated out|side of |
|00000560| 6f 62 6a 65 63 74 2d 64 | 65 66 69 6e 69 74 69 6f |object-d|efinitio|
|00000570| 6e 0d 0a 62 6c 6f 63 6b | 73 20 61 72 65 20 61 64 |n..block|s are ad|
|00000580| 64 65 64 20 74 6f 20 74 | 68 65 20 57 6f 72 6c 64 |ded to t|he World|
|00000590| 20 6f 62 6a 65 63 74 3b | 20 79 6f 75 20 6e 65 65 | object;| you nee|
|000005a0| 64 20 6e 6f 74 20 28 6e | 6f 72 20 73 68 6f 75 6c |d not (n|or shoul|
|000005b0| 64 20 79 6f 75 29 0d 0a | 64 65 66 69 6e 65 20 74 |d you)..|define t|
|000005c0| 68 65 20 57 6f 72 6c 64 | 20 6f 62 6a 65 63 74 20 |he World| object |
|000005d0| 65 78 70 6c 69 63 69 74 | 6c 79 20 69 6e 20 74 68 |explicit|ly in th|
|000005e0| 65 20 69 6e 70 75 74 20 | 66 69 6c 65 2e 0d 0a 0d |e input |file....|
|000005f0| 0a 5c 73 65 63 74 69 6f | 6e 7b 50 72 69 6d 69 74 |.\sectio|n{Primit|
|00000600| 69 76 65 73 7d 0d 0a 0d | 0a 50 72 69 6d 69 74 69 |ives}...|.Primiti|
|00000610| 76 65 20 6f 62 6a 65 63 | 74 73 20 61 72 65 20 74 |ve objec|ts are t|
|00000620| 68 65 20 62 75 69 6c 64 | 69 6e 67 20 62 6f 78 20 |he build|ing box |
|00000630| 77 69 74 68 20 77 68 69 | 63 68 20 6f 74 68 65 72 |with whi|ch other|
|00000640| 20 6f 62 6a 65 63 74 73 | 20 61 72 65 0d 0a 63 72 | objects| are..cr|
|00000650| 65 61 74 65 64 2e 20 20 | 45 61 63 68 20 70 72 69 |eated. |Each pri|
|00000660| 6d 69 74 69 76 65 20 74 | 79 70 65 20 68 61 73 20 |mitive t|ype has |
|00000670| 61 73 73 6f 63 69 61 74 | 65 64 20 77 69 74 68 20 |associat|ed with |
|00000680| 69 74 20 73 70 65 63 69 | 61 6c 69 7a 65 64 0d 0a |it speci|alized..|
|00000690| 6d 65 74 68 6f 64 73 20 | 66 6f 72 0d 0a 63 72 65 |methods |for..cre|
|000006a0| 61 74 69 6f 6e 2c 0d 0a | 69 6e 74 65 72 73 65 63 |ation,..|intersec|
|000006b0| 74 69 6f 6e 20 77 69 74 | 68 20 61 20 72 61 79 2c |tion wit|h a ray,|
|000006c0| 0d 0a 62 6f 75 6e 64 69 | 6e 67 20 62 6f 78 20 63 |..boundi|ng box c|
|000006d0| 61 6c 63 75 6c 61 74 69 | 6f 6e 2c 0d 0a 73 75 72 |alculati|on,..sur|
|000006e0| 66 61 63 65 20 6e 6f 72 | 6d 61 6c 20 63 61 6c 63 |face nor|mal calc|
|000006f0| 75 6c 61 74 69 6f 6e 2c | 0d 0a 72 61 79 20 65 6e |ulation,|..ray en|
|00000700| 74 65 72 2f 65 78 69 74 | 20 63 6c 61 73 73 69 66 |ter/exit| classif|
|00000710| 69 63 61 74 69 6f 6e 2c | 0d 0a 61 6e 64 20 66 6f |ication,|..and fo|
|00000720| 72 20 74 68 65 20 63 6f | 6d 70 75 74 61 74 69 6f |r the co|mputatio|
|00000730| 6e 20 32 44 20 74 65 78 | 74 75 72 65 20 63 6f 6f |n 2D tex|ture coo|
|00000740| 72 64 69 6e 61 74 65 73 | 20 74 65 72 6d 65 64 20 |rdinates| termed |
|00000750| 7b 5c 65 6d 20 75 2d 76 | 7d 0d 0a 63 6f 6f 72 64 |{\em u-v|}..coord|
|00000760| 69 6e 61 74 65 73 2e 0d | 0a 54 68 69 73 20 6c 61 |inates..|.This la|
|00000770| 74 74 65 72 20 6d 65 74 | 68 6f 64 20 69 73 20 6f |tter met|hod is o|
|00000780| 66 74 65 6e 20 72 65 66 | 65 72 72 65 64 20 74 6f |ften ref|erred to|
|00000790| 20 61 73 20 74 68 65 20 | 7b 5c 65 6d 20 69 6e 76 | as the |{\em inv|
|000007a0| 65 72 73 65 20 6d 61 70 | 70 69 6e 67 7d 0d 0a 6d |erse map|ping}..m|
|000007b0| 65 74 68 6f 64 2e 0d 0a | 0d 0a 57 68 69 6c 65 20 |ethod...|..While |
|000007c0| 6d 6f 73 74 20 6f 66 20 | 74 68 65 73 65 20 6d 65 |most of |these me|
|000007d0| 74 68 6f 64 73 20 73 68 | 6f 75 6c 64 20 62 65 20 |thods sh|ould be |
|000007e0| 6f 66 20 6c 69 74 74 6c | 65 20 63 6f 6e 63 65 72 |of littl|e concer|
|000007f0| 6e 20 74 6f 20 79 6f 75 | 2c 20 74 68 65 0d 0a 69 |n to you|, the..i|
|00000800| 6e 76 65 72 73 65 20 6d | 61 70 70 69 6e 67 20 6d |nverse m|apping m|
|00000810| 65 74 68 6f 64 73 0d 0a | 77 69 6c 6c 20 61 66 66 |ethods..|will aff|
|00000820| 65 63 74 20 74 68 65 20 | 77 61 79 20 69 6e 20 77 |ect the |way in w|
|00000830| 68 69 63 68 20 63 65 72 | 74 61 69 6e 20 74 65 78 |hich cer|tain tex|
|00000840| 74 75 72 65 73 20 61 72 | 65 20 61 70 70 6c 69 65 |tures ar|e applie|
|00000850| 64 20 74 6f 20 70 72 69 | 6d 69 74 69 76 65 73 2e |d to pri|mitives.|
|00000860| 0d 0a 49 6e 76 65 72 73 | 65 20 6d 61 70 70 69 6e |..Invers|e mappin|
|00000870| 67 20 69 73 20 61 20 6d | 61 74 74 65 72 20 6f 66 |g is a m|atter of|
|00000880| 20 63 6f 6d 70 75 74 69 | 6e 67 20 6e 6f 72 6d 61 | computi|ng norma|
|00000890| 6c 69 7a 65 64 20 24 75 | 24 20 61 6e 64 20 24 76 |lized $u|$ and $v|
|000008a0| 24 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 0d 0a 66 |$ coordi|nates..f|
|000008b0| 6f 72 20 61 20 67 69 76 | 65 6e 20 70 6f 69 6e 74 |or a giv|en point|
|000008c0| 20 6f 6e 20 74 68 65 20 | 73 75 72 66 61 63 65 20 | on the |surface |
|000008d0| 6f 66 20 74 68 65 20 70 | 72 69 6d 69 74 69 76 65 |of the p|rimitive|
|000008e0| 2e 20 20 46 6f 72 20 70 | 6c 61 6e 61 72 20 6f 62 |. For p|lanar ob|
|000008f0| 6a 65 63 74 73 2c 0d 0a | 74 68 65 20 24 75 24 20 |jects,..|the $u$ |
|00000900| 61 6e 64 20 24 76 24 20 | 63 6f 6f 72 64 69 6e 61 |and $v$ |coordina|
|00000910| 74 65 73 20 6f 66 20 61 | 20 70 6f 69 6e 74 20 61 |tes of a| point a|
|00000920| 72 65 20 63 6f 6d 70 75 | 74 65 64 0d 0a 62 79 20 |re compu|ted..by |
|00000930| 6c 69 6e 65 61 72 20 69 | 6e 74 65 72 70 6f 6c 61 |linear i|nterpola|
|00000940| 74 69 6f 6e 20 62 61 73 | 65 64 20 75 70 6f 6e 20 |tion bas|ed upon |
|00000950| 74 68 65 20 24 75 24 20 | 61 6e 64 20 24 76 24 20 |the $u$ |and $v$ |
|00000960| 63 6f 6f 72 64 69 6e 61 | 74 65 73 20 61 73 73 69 |coordina|tes assi|
|00000970| 67 6e 65 64 0d 0a 74 6f | 20 76 65 72 74 69 63 65 |gned..to| vertice|
|00000980| 73 20 6f 72 20 6f 74 68 | 65 72 20 6b 6e 6f 77 6e |s or oth|er known|
|00000990| 20 70 6f 69 6e 74 73 20 | 6f 6e 20 74 68 65 20 70 | points |on the p|
|000009a0| 72 69 6d 69 74 69 76 65 | 2e 20 20 46 6f 72 20 6e |rimitive|. For n|
|000009b0| 6f 6e 2d 70 6c 61 6e 61 | 72 0d 0a 6f 62 6a 65 63 |on-plana|r..objec|
|000009c0| 74 73 2c 20 24 75 76 24 | 20 63 6f 6d 70 75 74 61 |ts, $uv$| computa|
|000009d0| 74 69 6f 6e 20 63 61 6e | 20 62 65 20 63 6f 6e 73 |tion can| be cons|
|000009e0| 69 64 65 72 61 62 6c 79 | 20 6d 6f 72 65 20 69 6e |iderably| more in|
|000009f0| 76 6f 6c 76 65 64 2e 0d | 0a 0d 0a 54 68 69 73 20 |volved..|...This |
|00000a00| 73 65 63 74 69 6f 6e 20 | 62 72 69 65 66 6c 79 20 |section |briefly |
|00000a10| 64 65 73 63 72 69 62 65 | 73 20 65 61 63 68 20 70 |describe|s each p|
|00000a20| 72 69 6d 69 74 69 76 65 | 20 61 6e 64 0d 0a 74 68 |rimitive| and..th|
|00000a30| 65 20 73 79 6e 74 61 78 | 20 74 68 61 74 20 73 68 |e syntax| that sh|
|00000a40| 6f 75 6c 64 20 62 65 20 | 75 73 65 64 20 74 6f 20 |ould be |used to |
|00000a50| 63 72 65 61 74 65 20 61 | 6e 20 69 6e 73 74 61 6e |create a|n instan|
|00000a60| 63 65 20 6f 66 20 74 68 | 65 20 70 72 69 6d 69 74 |ce of th|e primit|
|00000a70| 69 76 65 2e 0d 0a 49 74 | 20 61 6c 73 6f 20 64 65 |ive...It| also de|
|00000a80| 73 63 72 69 62 65 73 20 | 74 68 65 20 69 6e 76 65 |scribes |the inve|
|00000a90| 72 73 65 20 6d 61 70 70 | 69 6e 67 20 6d 65 74 68 |rse mapp|ing meth|
|00000aa0| 6f 64 2c 20 69 66 20 61 | 6e 79 2c 20 66 6f 72 20 |od, if a|ny, for |
|00000ab0| 65 61 63 68 20 74 79 70 | 65 2e 0d 0a 0d 0a 5c 62 |each typ|e.....\b|
|00000ac0| 65 67 69 6e 7b 64 65 66 | 70 72 69 6d 7d 7b 62 6c |egin{def|prim}{bl|
|00000ad0| 6f 62 7d 7b 7b 5c 65 6d | 20 74 68 72 65 73 68 20 |ob}{{\em| thresh |
|00000ae0| 73 74 20 72 7d 20 5c 65 | 76 65 63 7b 70 7d 20 5b |st r} \e|vec{p} [|
|00000af0| 7b 5c 65 6d 20 73 74 20 | 72 7d 20 5c 65 76 65 63 |{\em st |r} \evec|
|00000b00| 7b 70 7d 20 5c 6c 64 6f | 74 73 5d 7d 0d 0a 09 44 |{p} \ldo|ts]}...D|
|00000b10| 65 66 69 6e 65 73 20 61 | 20 62 6c 6f 62 20 77 69 |efines a| blob wi|
|00000b20| 74 68 20 63 6f 6e 73 69 | 73 74 69 6e 67 20 6f 66 |th consi|sting of|
|00000b30| 20 61 20 74 68 72 65 73 | 68 6f 6c 64 20 65 71 75 | a thres|hold equ|
|00000b40| 61 6c 20 74 6f 20 7b 5c | 65 6d 20 74 68 72 65 73 |al to {\|em thres|
|00000b50| 68 7d 2c 0d 0a 09 61 6e | 64 20 61 0d 0a 09 67 72 |h},...an|d a...gr|
|00000b60| 6f 75 70 20 6f 66 20 6f | 6e 65 20 6f 72 20 6d 6f |oup of o|ne or mo|
|00000b70| 72 65 20 6d 65 74 61 62 | 61 6c 6c 73 2e 20 20 45 |re metab|alls. E|
|00000b80| 61 63 68 20 6d 65 74 61 | 62 61 6c 6c 20 69 73 20 |ach meta|ball is |
|00000b90| 64 65 66 69 6e 65 64 20 | 62 79 20 0d 0a 09 69 74 |defined |by ...it|
|00000ba0| 73 20 70 6f 73 69 74 69 | 6f 6e 20 5c 65 76 65 63 |s positi|on \evec|
|00000bb0| 7b 70 7d 2c 20 72 61 64 | 69 75 73 20 7b 5c 65 6d |{p}, rad|ius {\em|
|00000bc0| 20 72 7d 2c 20 61 6e 64 | 20 73 74 72 65 6e 67 74 | r}, and| strengt|
|00000bd0| 68 20 7b 5c 65 6d 20 73 | 74 7d 2e 0d 0a 5c 65 6e |h {\em s|t}...\en|
|00000be0| 64 7b 64 65 66 70 72 69 | 6d 7d 0d 0a 54 68 65 20 |d{defpri|m}..The |
|00000bf0| 6d 65 74 61 62 61 6c 6c | 73 20 61 66 66 65 63 74 |metaball|s affect|
|00000c00| 20 65 61 63 68 20 6f 74 | 68 65 72 20 61 63 63 6f | each ot|her acco|
|00000c10| 72 64 69 6e 67 20 74 6f | 20 61 20 73 75 70 65 72 |rding to| a super|
|00000c20| 69 6d 70 6f 73 65 64 0d | 0a 64 65 6e 73 69 74 79 |imposed.|.density|
|00000c30| 20 64 69 73 74 72 69 62 | 75 74 69 6f 6e 3a 0d 0a | distrib|ution:..|
|00000c40| 5c 5b 0d 0a 46 28 78 2c | 79 2c 7a 29 20 3d 20 5c |\[..F(x,|y,z) = \|
|00000c50| 73 75 6d 5f 7b 69 3d 30 | 7d 5e 6e 20 62 5f 7b 69 |sum_{i=0|}^n b_{i|
|00000c60| 7d 65 5e 7b 2d 64 5f 7b | 69 7d 7d 20 2d 20 54 20 |}e^{-d_{|i}} - T |
|00000c70| 3d 20 30 0d 0a 5c 5d 0d | 0a 54 68 65 72 65 20 69 |= 0..\].|.There i|
|00000c80| 73 20 6e 6f 20 69 6e 76 | 65 72 73 65 20 6d 61 70 |s no inv|erse map|
|00000c90| 70 69 6e 67 20 6d 65 74 | 68 6f 64 20 66 6f 72 20 |ping met|hod for |
|00000ca0| 62 6c 6f 62 73 2e 0d 0a | 0d 0a 5c 62 65 67 69 6e |blobs...|..\begin|
|00000cb0| 7b 64 65 66 70 72 69 6d | 7d 7b 62 6f 78 7d 7b 5c |{defprim|}{box}{\|
|00000cc0| 65 76 65 63 7b 63 6f 72 | 6e 65 72 31 7d 20 5c 65 |evec{cor|ner1} \e|
|00000cd0| 76 65 63 7b 63 6f 72 6e | 65 72 32 7d 7d 0d 0a 09 |vec{corn|er2}}...|
|00000ce0| 43 72 65 61 74 65 73 20 | 61 6e 20 61 78 69 73 2d |Creates |an axis-|
|00000cf0| 61 6c 69 67 6e 65 64 20 | 62 6f 78 0d 0a 09 77 68 |aligned |box...wh|
|00000d00| 69 63 68 20 68 61 73 20 | 5c 65 76 65 63 7b 63 6f |ich has |\evec{co|
|00000d10| 72 6e 65 72 31 7d 20 61 | 6e 64 20 5c 65 76 65 63 |rner1} a|nd \evec|
|00000d20| 7b 63 6f 72 6e 65 72 32 | 7d 20 61 73 0d 0a 09 6f |{corner2|} as...o|
|00000d30| 70 70 6f 73 69 74 65 20 | 63 6f 72 6e 65 72 73 2e |pposite |corners.|
|00000d40| 0d 0a 5c 65 6e 64 7b 64 | 65 66 70 72 69 6d 7d 0d |..\end{d|efprim}.|
|00000d50| 0a 54 72 61 6e 73 66 6f | 72 6d 61 74 69 6f 6e 73 |.Transfo|rmations|
|00000d60| 20 6d 61 79 20 62 65 20 | 61 70 70 6c 69 65 64 20 | may be |applied |
|00000d70| 74 6f 20 74 68 65 20 62 | 6f 78 20 69 66 20 61 20 |to the b|ox if a |
|00000d80| 6e 6f 6e 2d 61 78 69 73 | 2d 61 6c 69 67 6e 65 64 |non-axis|-aligned|
|00000d90| 20 69 6e 73 74 61 6e 63 | 65 0d 0a 69 73 20 72 65 | instanc|e..is re|
|00000da0| 71 75 69 72 65 64 2e 20 | 20 54 68 65 72 65 20 69 |quired. | There i|
|00000db0| 73 20 6e 6f 20 69 6e 76 | 65 72 73 65 20 6d 61 70 |s no inv|erse map|
|00000dc0| 70 69 6e 67 20 6d 65 74 | 68 6f 64 20 66 6f 72 20 |ping met|hod for |
|00000dd0| 62 6f 78 65 73 2e 0d 0a | 0d 0a 5c 62 65 67 69 6e |boxes...|..\begin|
|00000de0| 7b 64 65 66 70 72 69 6d | 7d 7b 73 70 68 65 72 65 |{defprim|}{sphere|
|00000df0| 7d 7b 7b 5c 65 6d 20 72 | 61 64 69 75 73 7d 20 5c |}{{\em r|adius} \|
|00000e00| 65 76 65 63 7b 63 65 6e | 74 65 72 7d 7d 0d 0a 09 |evec{cen|ter}}...|
|00000e10| 43 72 65 61 74 65 73 20 | 61 20 73 70 68 65 72 65 |Creates |a sphere|
|00000e20| 20 77 69 74 68 20 74 68 | 65 20 67 69 76 65 6e 20 | with th|e given |
|00000e30| 7b 5c 65 6d 20 72 61 64 | 69 75 73 7d 20 61 6e 64 |{\em rad|ius} and|
|00000e40| 20 63 65 6e 74 65 72 65 | 64 20 61 74 20 74 68 65 | centere|d at the|
|00000e50| 0d 0a 09 67 69 76 65 6e | 20 70 6f 73 69 74 69 6f |...given| positio|
|00000e60| 6e 2e 0d 0a 5c 65 6e 64 | 7b 64 65 66 70 72 69 6d |n...\end|{defprim|
|00000e70| 7d 0d 0a 4e 6f 74 65 20 | 74 68 61 74 20 65 6c 6c |}..Note |that ell|
|00000e80| 69 70 73 6f 69 64 73 20 | 6d 61 79 20 62 65 20 63 |ipsoids |may be c|
|00000e90| 72 65 61 74 65 64 20 62 | 79 20 61 70 70 6c 79 69 |reated b|y applyi|
|00000ea0| 6e 67 20 74 68 65 20 70 | 72 6f 70 65 72 20 73 63 |ng the p|roper sc|
|00000eb0| 61 6c 69 6e 67 0d 0a 74 | 6f 20 61 20 73 70 68 65 |aling..t|o a sphe|
|00000ec0| 72 65 2e 20 20 49 6e 76 | 65 72 73 65 20 6d 61 70 |re. Inv|erse map|
|00000ed0| 70 69 6e 67 20 6f 6e 20 | 74 68 65 20 73 70 68 65 |ping on |the sphe|
|00000ee0| 72 65 20 69 73 20 61 63 | 63 6f 6d 70 6c 69 73 68 |re is ac|complish|
|00000ef0| 65 64 0d 0a 62 79 20 63 | 6f 6d 70 75 74 69 6e 67 |ed..by c|omputing|
|00000f00| 20 74 68 65 20 6c 6f 6e | 67 69 74 75 64 65 20 61 | the lon|gitude a|
|00000f10| 6e 64 20 6c 61 74 69 74 | 75 64 65 20 6f 66 20 74 |nd latit|ude of t|
|00000f20| 68 65 20 70 6f 69 6e 74 | 20 6f 6e 20 74 68 65 20 |he point| on the |
|00000f30| 73 70 68 65 72 65 2c 0d | 0a 77 69 74 68 20 74 68 |sphere,.|.with th|
|00000f40| 65 20 24 75 24 20 76 61 | 6c 75 65 20 63 6f 72 72 |e $u$ va|lue corr|
|00000f50| 65 73 70 6f 6e 64 69 6e | 67 20 74 6f 20 6c 6f 6e |espondin|g to lon|
|00000f60| 67 69 74 75 64 65 20 61 | 6e 64 20 24 76 24 20 74 |gitude a|nd $v$ t|
|00000f70| 6f 20 6c 61 74 69 74 75 | 64 65 2e 0d 0a 4f 6e 20 |o latitu|de...On |
|00000f80| 61 6e 20 75 6e 74 72 61 | 6e 73 66 6f 72 6d 65 64 |an untra|nsformed|
|00000f90| 20 73 70 68 65 72 65 2c | 20 74 68 65 20 24 7a 24 | sphere,| the $z$|
|00000fa0| 20 61 78 69 73 20 64 65 | 66 69 6e 65 73 20 74 68 | axis de|fines th|
|00000fb0| 65 20 70 6f 6c 65 73 2c | 20 61 6e 64 20 74 68 65 |e poles,| and the|
|00000fc0| 0d 0a 24 78 24 20 61 78 | 69 73 20 69 6e 74 65 72 |..$x$ ax|is inter|
|00000fd0| 73 65 63 74 73 20 74 68 | 65 20 73 70 68 65 72 65 |sects th|e sphere|
|00000fe0| 20 61 74 20 24 75 20 3d | 20 30 24 2c 20 24 76 20 | at $u =| 0$, $v |
|00000ff0| 3d 20 30 2e 35 24 2e 20 | 20 54 68 65 72 65 20 61 |= 0.5$. | There a|
|00001000| 72 65 0d 0a 64 65 67 65 | 6e 65 72 61 63 69 65 73 |re..dege|neracies|
|00001010| 20 61 74 20 74 68 65 20 | 70 6f 6c 65 73 3a 20 74 | at the |poles: t|
|00001020| 68 65 20 73 6f 75 74 68 | 20 70 6f 6c 65 20 63 6f |he south| pole co|
|00001030| 6e 74 61 69 6e 73 20 61 | 6c 6c 20 70 6f 69 6e 74 |ntains a|ll point|
|00001040| 73 20 6f 66 0d 0a 6c 61 | 74 69 74 75 64 65 20 30 |s of..la|titude 0|
|00001050| 2e 2c 20 74 68 65 20 6e | 6f 72 74 68 20 61 6c 6c |., the n|orth all|
|00001060| 20 70 6f 69 6e 74 73 20 | 6f 66 20 6c 61 74 69 74 | points |of latit|
|00001070| 75 64 65 20 31 2e 0d 0a | 0d 0a 5c 62 65 67 69 6e |ude 1...|..\begin|
|00001080| 7b 64 65 66 70 72 69 6d | 7d 7b 74 6f 72 75 73 7d |{defprim|}{torus}|
|00001090| 7b 7b 5c 65 6d 20 72 6d | 61 6a 6f 72 20 72 6d 69 |{{\em rm|ajor rmi|
|000010a0| 6e 6f 72 7d 20 5c 65 76 | 65 63 7b 63 65 6e 74 65 |nor} \ev|ec{cente|
|000010b0| 72 7d 20 5c 65 76 65 63 | 7b 75 70 7d 7d 0d 0a 09 |r} \evec|{up}}...|
|000010c0| 43 72 65 61 74 65 73 20 | 61 20 74 6f 72 75 73 20 |Creates |a torus |
|000010d0| 63 65 6e 74 65 72 65 64 | 20 61 74 20 5c 65 76 65 |centered| at \eve|
|000010e0| 63 7b 63 65 6e 74 65 72 | 7d 20 62 79 20 72 6f 74 |c{center|} by rot|
|000010f0| 61 74 69 6e 67 0d 0a 09 | 61 20 63 69 72 63 6c 65 |ating...|a circle|
|00001100| 20 77 69 74 68 20 74 68 | 65 20 67 69 76 65 6e 20 | with th|e given |
|00001110| 6d 69 6e 6f 72 20 72 61 | 64 69 75 73 20 61 72 6f |minor ra|dius aro|
|00001120| 75 6e 64 20 74 68 65 20 | 63 65 6e 74 65 72 0d 0a |und the |center..|
|00001130| 09 70 6f 69 6e 74 20 61 | 74 20 61 20 64 69 73 74 |.point a|t a dist|
|00001140| 61 6e 63 65 20 65 71 75 | 61 6c 20 74 6f 20 74 68 |ance equ|al to th|
|00001150| 65 20 6d 61 6a 6f 72 20 | 72 61 64 69 75 73 2e 20 |e major |radius. |
|00001160| 0d 0a 5c 65 6e 64 7b 64 | 65 66 70 72 69 6d 7d 0d |..\end{d|efprim}.|
|00001170| 0a 49 6e 20 74 6f 72 69 | 20 69 6e 76 65 72 73 65 |.In tori| inverse|
|00001180| 20 6d 61 70 70 69 6e 67 | 2c 0d 0a 74 68 65 20 24 | mapping|,..the $|
|00001190| 75 24 20 76 61 6c 75 65 | 20 69 73 20 63 6f 6d 70 |u$ value| is comp|
|000011a0| 75 74 65 64 20 75 73 69 | 6e 67 20 74 68 65 20 61 |uted usi|ng the a|
|000011b0| 6e 67 6c 65 20 6f 66 20 | 72 6f 74 61 74 69 6f 6e |ngle of |rotation|
|000011c0| 20 61 62 6f 75 74 20 74 | 68 65 0d 0a 75 70 20 76 | about t|he..up v|
|000011d0| 65 63 74 6f 72 2c 20 61 | 6e 64 20 74 68 65 20 24 |ector, a|nd the $|
|000011e0| 76 24 20 76 61 6c 75 65 | 20 69 73 20 63 6f 6d 70 |v$ value| is comp|
|000011f0| 75 74 69 6e 67 20 74 68 | 65 20 61 6e 67 6c 65 20 |uting th|e angle |
|00001200| 6f 66 20 72 6f 74 61 74 | 69 6f 6e 0d 0a 61 72 6f |of rotat|ion..aro|
|00001210| 75 6e 64 20 74 68 65 20 | 74 75 62 65 2c 20 77 69 |und the |tube, wi|
|00001220| 74 68 20 24 76 3d 30 24 | 20 6f 63 63 75 72 69 6e |th $v=0$| occurin|
|00001230| 67 20 6f 6e 20 74 68 65 | 20 69 6e 6e 65 72 6d 6f |g on the| innermo|
|00001240| 73 74 20 70 6f 69 6e 74 | 20 6f 66 20 74 68 65 20 |st point| of the |
|00001250| 74 75 62 65 2e 0d 0a 0d | 0a 5c 62 65 67 69 6e 7b |tube....|.\begin{|
|00001260| 64 65 66 70 72 69 6d 7d | 7b 74 72 69 61 6e 67 6c |defprim}|{triangl|
|00001270| 65 7d 7b 5c 65 76 65 63 | 7b 70 31 7d 20 5c 65 76 |e}{\evec|{p1} \ev|
|00001280| 65 63 7b 70 32 7d 20 5c | 65 76 65 63 7b 70 33 7d |ec{p2} \|evec{p3}|
|00001290| 7d 0d 0a 09 43 72 65 61 | 74 65 73 20 61 20 74 72 |}...Crea|tes a tr|
|000012a0| 69 61 6e 67 6c 65 20 77 | 69 74 68 20 74 68 65 20 |iangle w|ith the |
|000012b0| 67 69 76 65 6e 20 76 65 | 72 74 69 63 65 73 2e 0d |given ve|rtices..|
|000012c0| 0a 5c 65 6e 64 7b 64 65 | 66 70 72 69 6d 7d 0d 0a |.\end{de|fprim}..|
|000012d0| 0d 0a 5c 62 65 67 69 6e | 7b 64 65 66 70 72 69 6d |..\begin|{defprim|
|000012e0| 7d 7b 74 72 69 61 6e 67 | 6c 65 7d 7b 5c 65 76 65 |}{triang|le}{\eve|
|000012f0| 63 7b 70 31 7d 20 5c 65 | 76 65 63 7b 6e 31 7d 20 |c{p1} \e|vec{n1} |
|00001300| 5c 65 76 65 63 7b 70 32 | 7d 20 5c 65 76 65 63 7b |\evec{p2|} \evec{|
|00001310| 6e 32 7d 0d 0a 09 5c 65 | 76 65 63 7b 70 33 7d 20 |n2}...\e|vec{p3} |
|00001320| 5c 65 76 65 63 7b 6e 33 | 7d 7d 0d 0a 09 43 72 65 |\evec{n3|}}...Cre|
|00001330| 61 74 65 73 20 61 20 50 | 68 6f 6e 67 2d 73 68 61 |ates a P|hong-sha|
|00001340| 64 65 64 20 74 72 69 61 | 6e 67 6c 65 20 77 69 74 |ded tria|ngle wit|
|00001350| 68 20 74 68 65 20 67 69 | 76 65 6e 20 76 65 72 74 |h the gi|ven vert|
|00001360| 69 63 65 73 20 61 6e 64 | 0d 0a 09 76 65 72 74 65 |ices and|...verte|
|00001370| 78 20 6e 6f 72 6d 61 6c | 73 2e 0d 0a 5c 65 6e 64 |x normal|s...\end|
|00001380| 7b 64 65 66 70 72 69 6d | 7d 0d 0a 46 6f 72 20 62 |{defprim|}..For b|
|00001390| 6f 74 68 20 50 68 6f 6e | 67 2d 20 61 6e 64 20 66 |oth Phon|g- and f|
|000013a0| 6c 61 74 2d 73 68 61 64 | 65 64 20 74 72 69 61 6e |lat-shad|ed trian|
|000013b0| 67 6c 65 73 2c 20 74 68 | 65 20 24 75 24 20 61 78 |gles, th|e $u$ ax|
|000013c0| 69 73 20 69 73 20 74 68 | 65 0d 0a 76 65 63 74 6f |is is th|e..vecto|
|000013d0| 72 20 66 72 6f 6d 20 5c | 65 76 65 63 7b 70 31 7d |r from \|evec{p1}|
|000013e0| 20 74 6f 20 5c 65 76 65 | 63 7b 70 32 7d 2c 20 61 | to \eve|c{p2}, a|
|000013f0| 6e 64 20 74 68 65 20 24 | 76 24 20 61 78 69 73 20 |nd the $|v$ axis |
|00001400| 74 68 65 20 76 65 63 74 | 6f 72 0d 0a 66 72 6f 6d |the vect|or..from|
|00001410| 20 5c 65 76 65 63 7b 70 | 31 7d 20 74 6f 20 5c 65 | \evec{p|1} to \e|
|00001420| 76 65 63 7b 70 33 7d 2e | 20 20 54 68 65 72 65 20 |vec{p3}.| There |
|00001430| 69 73 20 61 20 64 65 67 | 65 6e 65 72 61 63 79 20 |is a deg|eneracy |
|00001440| 61 74 0d 0a 5c 65 76 65 | 63 7b 70 33 7d 2c 20 77 |at..\eve|c{p3}, w|
|00001450| 68 69 63 68 20 63 6f 6e | 74 61 69 6e 73 20 61 6c |hich con|tains al|
|00001460| 6c 20 70 6f 69 6e 74 73 | 20 77 69 74 68 20 24 76 |l points| with $v|
|00001470| 20 3d 20 31 2e 30 24 2e | 20 20 54 68 69 73 20 64 | = 1.0$.| This d|
|00001480| 65 66 61 75 6c 74 0d 0a | 6d 61 70 70 69 6e 67 20 |efault..|mapping |
|00001490| 6d 61 79 20 62 65 20 6d | 6f 64 69 66 69 65 64 20 |may be m|odified |
|000014a0| 75 73 69 6e 67 20 74 68 | 65 20 7b 5c 74 74 20 74 |using th|e {\tt t|
|000014b0| 72 69 61 6e 67 6c 65 75 | 76 7d 20 70 72 69 6d 69 |riangleu|v} primi|
|000014c0| 74 69 76 65 20 64 65 73 | 63 72 69 62 65 64 0d 0a |tive des|cribed..|
|000014d0| 62 65 6c 6f 77 2e 0d 0a | 0d 0a 5c 62 65 67 69 6e |below...|..\begin|
|000014e0| 7b 64 65 66 70 72 69 6d | 7d 7b 74 72 69 61 6e 67 |{defprim|}{triang|
|000014f0| 6c 65 75 76 7d 7b 5c 65 | 76 65 63 7b 70 31 7d 20 |leuv}{\e|vec{p1} |
|00001500| 5c 65 76 65 63 7b 6e 31 | 7d 20 5c 65 76 65 63 7b |\evec{n1|} \evec{|
|00001510| 75 76 31 7d 0d 0a 20 20 | 5c 65 76 65 63 7b 70 32 |uv1}.. |\evec{p2|
|00001520| 7d 20 5c 65 76 65 63 7b | 6e 32 7d 20 5c 65 76 65 |} \evec{|n2} \eve|
|00001530| 63 7b 75 76 32 7d 0d 0a | 20 20 5c 65 76 65 63 7b |c{uv2}..| \evec{|
|00001540| 70 33 7d 20 5c 65 76 65 | 63 7b 6e 33 7d 20 5c 65 |p3} \eve|c{n3} \e|
|00001550| 76 65 63 7b 75 76 33 7d | 7d 0d 0a 09 43 72 65 61 |vec{uv3}|}...Crea|
|00001560| 74 65 73 20 61 20 50 68 | 6f 6e 67 2d 73 68 61 64 |tes a Ph|ong-shad|
|00001570| 65 64 20 74 72 69 61 6e | 67 6c 65 20 77 69 74 68 |ed trian|gle with|
|00001580| 20 74 68 65 20 67 69 76 | 65 6e 20 76 65 72 74 69 | the giv|en verti|
|00001590| 63 65 73 2c 0d 0a 09 76 | 65 72 74 65 78 20 6e 6f |ces,...v|ertex no|
|000015a0| 72 6d 61 6c 73 2e 20 20 | 57 68 65 6e 20 70 65 72 |rmals. |When per|
|000015b0| 66 6f 72 6d 69 6e 67 20 | 74 65 78 74 75 72 69 6e |forming |texturin|
|000015c0| 67 2c 20 74 68 65 0d 0a | 09 7b 5c 65 6d 20 75 76 |g, the..|.{\em uv|
|000015d0| 7d 20 67 69 76 65 6e 20 | 66 6f 72 20 65 61 63 68 |} given |for each|
|000015e0| 20 76 65 72 74 65 78 20 | 61 72 65 20 75 73 65 64 | vertex |are used|
|000015f0| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 74 68 65 0d | instead| of the.|
|00001600| 0a 09 64 65 66 61 75 6c | 74 20 76 61 6c 75 65 73 |..defaul|t values|
|00001610| 2e 0d 0a 5c 65 6e 64 7b | 64 65 66 70 72 69 6d 7d |...\end{|defprim}|
|00001620| 0d 0a 57 68 65 6e 20 63 | 6f 6d 70 75 74 69 6e 67 |..When c|omputing|
|00001630| 20 24 75 76 24 20 63 6f | 6f 72 64 69 6e 61 74 65 | $uv$ co|ordinate|
|00001640| 73 20 77 69 74 68 69 6e | 20 74 68 65 20 69 6e 74 |s within| the int|
|00001650| 65 72 69 6f 72 20 6f 66 | 20 74 68 65 0d 0a 74 72 |erior of| the..tr|
|00001660| 69 61 6e 67 6c 65 2c 20 | 6c 69 6e 65 61 72 20 69 |iangle, |linear i|
|00001670| 6e 74 65 72 70 6f 6c 61 | 74 69 6f 6e 20 6f 66 20 |nterpola|tion of |
|00001680| 74 68 65 20 63 6f 6f 72 | 64 69 6e 61 74 65 73 20 |the coor|dinates |
|00001690| 61 73 73 6f 63 69 61 74 | 65 64 20 77 69 74 68 0d |associat|ed with.|
|000016a0| 0a 65 61 63 68 20 74 72 | 69 61 6e 67 6c 65 20 76 |.each tr|iangle v|
|000016b0| 65 72 74 65 78 20 69 73 | 20 75 73 65 64 2e 0d 0a |ertex is| used...|
|000016c0| 0d 0a 5c 62 65 67 69 6e | 7b 64 65 66 70 72 69 6d |..\begin|{defprim|
|000016d0| 7d 7b 70 6f 6c 79 7d 7b | 5c 65 76 65 63 7b 70 31 |}{poly}{|\evec{p1|
|000016e0| 7d 20 5c 65 76 65 63 7b | 70 32 7d 20 5c 65 76 65 |} \evec{|p2} \eve|
|000016f0| 63 7b 70 33 7d 20 5b 5c | 65 76 65 63 7b 70 34 7d |c{p3} [\|evec{p4}|
|00001700| 20 5c 6c 64 6f 74 73 20 | 5d 7d 0d 0a 09 43 72 65 | \ldots |]}...Cre|
|00001710| 61 74 65 73 20 61 20 70 | 6f 6c 79 67 6f 6e 20 77 |ates a p|olygon w|
|00001720| 69 74 68 20 74 68 65 20 | 67 69 76 65 6e 20 76 65 |ith the |given ve|
|00001730| 72 74 69 63 65 73 2e 20 | 54 68 65 20 76 65 72 74 |rtices. |The vert|
|00001740| 69 63 65 73 0d 0a 09 73 | 68 6f 75 6c 64 20 62 65 |ices...s|hould be|
|00001750| 20 67 69 76 65 6e 20 69 | 6e 20 63 6f 75 6e 74 65 | given i|n counte|
|00001760| 72 2d 63 6c 6f 63 6b 77 | 69 73 65 20 6f 72 64 65 |r-clockw|ise orde|
|00001770| 72 20 61 73 20 6f 6e 65 | 20 69 73 0d 0a 09 6c 6f |r as one| is...lo|
|00001780| 6f 6b 69 6e 67 20 61 74 | 20 74 68 65 20 60 60 66 |oking at| the ``f|
|00001790| 72 6f 6e 74 27 27 20 73 | 69 64 65 20 6f 66 20 74 |ront'' s|ide of t|
|000017a0| 68 65 20 70 6f 6c 79 67 | 6f 6e 2e 20 20 54 68 65 |he polyg|on. The|
|000017b0| 20 6e 75 6d 62 65 72 20 | 6f 66 0d 0a 09 76 65 72 | number |of...ver|
|000017c0| 74 69 63 65 73 20 69 6e | 20 61 20 70 6f 6c 79 67 |tices in| a polyg|
|000017d0| 6f 6e 20 69 73 20 6c 69 | 6d 69 74 65 64 20 6f 6e |on is li|mited on|
|000017e0| 6c 79 20 62 79 20 61 76 | 61 69 6c 61 62 6c 65 20 |ly by av|ailable |
|000017f0| 6d 65 6d 6f 72 79 2e 0d | 0a 5c 65 6e 64 7b 64 65 |memory..|.\end{de|
|00001800| 66 70 72 69 6d 7d 0d 0a | 49 6e 76 65 72 73 65 20 |fprim}..|Inverse |
|00001810| 6d 61 70 70 69 6e 67 20 | 66 6f 72 20 61 72 62 69 |mapping |for arbi|
|00001820| 74 72 61 72 79 20 70 6f | 6c 79 67 6f 6e 73 20 69 |trary po|lygons i|
|00001830| 73 20 70 72 6f 62 6c 65 | 6d 61 74 69 63 61 6c 2e |s proble|matical.|
|00001840| 0d 0a 7b 5c 52 61 79 73 | 68 61 64 65 7d 0d 0a 70 |..{\Rays|hade}..p|
|00001850| 75 6e 74 73 20 61 6e 64 | 20 65 71 75 61 74 65 73 |unts and| equates|
|00001860| 20 24 75 24 20 77 69 74 | 68 20 74 68 65 20 24 78 | $u$ wit|h the $x|
|00001870| 24 20 63 6f 6f 72 64 69 | 6e 61 74 65 20 6f 66 20 |$ coordi|nate of |
|00001880| 74 68 65 20 70 6f 69 6e | 74 20 6f 66 20 69 6e 74 |the poin|t of int|
|00001890| 65 72 73 65 63 74 69 6f | 6e 2c 0d 0a 61 6e 64 20 |ersectio|n,..and |
|000018a0| 24 76 24 20 77 69 74 68 | 20 74 68 65 20 24 79 24 |$v$ with| the $y$|
|000018b0| 20 63 6f 6f 72 64 69 6e | 61 74 65 2e 0d 0a 0d 0a | coordin|ate.....|
|000018c0| 5c 62 65 67 69 6e 7b 64 | 65 66 70 72 69 6d 7d 7b |\begin{d|efprim}{|
|000018d0| 68 65 69 67 68 74 66 69 | 65 6c 64 7d 7b 7b 5c 65 |heightfi|eld}{{\e|
|000018e0| 6d 20 66 69 6c 65 7d 7d | 0d 0a 09 43 72 65 61 74 |m file}}|...Creat|
|000018f0| 65 73 20 61 20 68 65 69 | 67 68 74 20 66 69 65 6c |es a hei|ght fiel|
|00001900| 64 20 64 65 66 69 6e 65 | 64 20 62 79 20 74 68 65 |d define|d by the|
|00001910| 20 61 6c 74 69 74 75 64 | 65 20 64 61 74 61 20 73 | altitud|e data s|
|00001920| 74 6f 72 65 64 0d 0a 09 | 69 6e 20 74 68 65 20 6e |tored...|in the n|
|00001930| 61 6d 65 64 20 7b 5c 65 | 6d 20 66 69 6c 65 7d 2e |amed {\e|m file}.|
|00001940| 20 20 54 68 65 20 68 65 | 69 67 68 74 20 66 69 65 | The he|ight fie|
|00001950| 6c 64 20 69 73 20 62 61 | 73 65 64 20 75 70 6f 6e |ld is ba|sed upon|
|00001960| 0d 0a 09 70 65 72 74 75 | 72 62 61 74 69 6f 6e 73 |...pertu|rbations|
|00001970| 20 6f 66 20 74 68 65 20 | 75 6e 69 74 20 73 71 75 | of the |unit squ|
|00001980| 61 72 65 20 69 6e 20 74 | 68 65 20 24 7a 3d 30 24 |are in t|he $z=0$|
|00001990| 20 70 6c 61 6e 65 2c 20 | 61 6e 64 20 69 73 0d 0a | plane, |and is..|
|000019a0| 09 72 65 6e 64 65 72 65 | 64 20 61 73 20 61 20 73 |.rendere|d as a s|
|000019b0| 75 72 66 61 63 65 20 74 | 65 73 73 65 6c 6c 61 74 |urface t|essellat|
|000019c0| 65 64 20 62 79 20 72 69 | 67 68 74 20 69 73 6f 73 |ed by ri|ght isos|
|000019d0| 63 65 6c 65 73 20 74 72 | 69 61 6e 67 6c 65 73 2e |celes tr|iangles.|
|000019e0| 0d 0a 5c 65 6e 64 7b 64 | 65 66 70 72 69 6d 7d 0d |..\end{d|efprim}.|
|000019f0| 0a 53 65 65 20 41 70 70 | 65 6e 64 69 78 20 43 20 |.See App|endix C |
|00001a00| 66 6f 72 20 61 20 64 69 | 73 63 75 73 73 69 6f 6e |for a di|scussion|
|00001a10| 20 6f 66 20 74 68 65 20 | 66 6f 72 6d 61 74 20 6f | of the |format o|
|00001a20| 66 20 61 20 68 65 69 67 | 68 74 20 66 69 65 6c 64 |f a heig|ht field|
|00001a30| 20 66 69 6c 65 2e 0d 0a | 48 65 69 67 68 74 20 66 | file...|Height f|
|00001a40| 69 65 6c 64 20 69 6e 76 | 65 72 73 65 20 6d 61 70 |ield inv|erse map|
|00001a50| 70 69 6e 67 20 69 73 20 | 73 74 72 61 69 67 68 74 |ping is |straight|
|00001a60| 2d 66 6f 72 77 61 72 64 | 3a 20 20 24 75 24 20 69 |-forward|: $u$ i|
|00001a70| 73 20 74 68 65 0d 0a 24 | 78 24 20 63 6f 6f 72 64 |s the..$|x$ coord|
|00001a80| 69 6e 61 74 65 20 6f 66 | 20 74 68 65 20 70 6f 69 |inate of| the poi|
|00001a90| 6e 74 20 6f 66 20 69 6e | 74 65 72 73 65 63 74 69 |nt of in|tersecti|
|00001aa0| 6f 6e 2c 20 24 76 24 20 | 74 68 65 20 24 79 24 20 |on, $v$ |the $y$ |
|00001ab0| 63 6f 6f 72 64 69 6e 61 | 74 65 2e 0d 0a 0d 0a 5c |coordina|te.....\|
|00001ac0| 62 65 67 69 6e 7b 64 65 | 66 70 72 69 6d 7d 7b 70 |begin{de|fprim}{p|
|00001ad0| 6c 61 6e 65 7d 7b 5c 65 | 76 65 63 7b 70 6f 69 6e |lane}{\e|vec{poin|
|00001ae0| 74 7d 20 5c 65 76 65 63 | 7b 6e 6f 72 6d 61 6c 7d |t} \evec|{normal}|
|00001af0| 7d 0d 0a 09 43 72 65 61 | 74 65 73 20 61 20 70 6c |}...Crea|tes a pl|
|00001b00| 61 6e 65 20 74 68 61 74 | 20 70 61 73 73 65 73 20 |ane that| passes |
|00001b10| 74 68 72 6f 75 67 68 20 | 74 68 65 20 67 69 76 65 |through |the give|
|00001b20| 6e 20 70 6f 69 6e 74 20 | 61 6e 64 0d 0a 09 68 61 |n point |and...ha|
|00001b30| 73 20 74 68 65 20 73 70 | 65 63 69 66 69 65 64 20 |s the sp|ecified |
|00001b40| 6e 6f 72 6d 61 6c 2e 0d | 0a 5c 65 6e 64 7b 64 65 |normal..|.\end{de|
|00001b50| 66 70 72 69 6d 7d 0d 0a | 49 6e 76 65 72 73 65 20 |fprim}..|Inverse |
|00001b60| 6d 61 70 70 69 6e 67 20 | 6f 6e 20 74 68 65 20 70 |mapping |on the p|
|00001b70| 6c 61 6e 65 20 69 73 20 | 69 64 65 6e 74 69 63 61 |lane is |identica|
|00001b80| 6c 20 74 6f 20 70 6f 6c | 79 67 6f 6e 61 6c 20 69 |l to pol|ygonal i|
|00001b90| 6e 76 65 72 73 65 20 6d | 61 70 70 69 6e 67 2e 0d |nverse m|apping..|
|00001ba0| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 64 65 66 70 72 69 |...\begi|n{defpri|
|00001bb0| 6d 7d 7b 63 79 6c 69 6e | 64 65 72 7d 7b 7b 5c 65 |m}{cylin|der}{{\e|
|00001bc0| 6d 20 72 61 64 69 75 73 | 7d 20 5c 65 76 65 63 7b |m radius|} \evec{|
|00001bd0| 62 6f 74 74 6f 6d 7d 20 | 5c 65 76 65 63 7b 74 6f |bottom} |\evec{to|
|00001be0| 70 7d 7d 0d 0a 09 43 72 | 65 61 74 65 73 20 61 20 |p}}...Cr|eates a |
|00001bf0| 63 79 6c 69 6e 64 65 72 | 20 74 68 61 74 20 65 78 |cylinder| that ex|
|00001c00| 74 65 6e 64 73 20 66 72 | 6f 6d 20 5c 65 76 65 63 |tends fr|om \evec|
|00001c10| 7b 62 6f 74 74 6f 6d 7d | 20 74 6f 20 5c 65 76 65 |{bottom}| to \eve|
|00001c20| 63 7b 74 6f 70 7d 0d 0a | 09 61 6e 64 20 68 61 73 |c{top}..|.and has|
|00001c30| 20 74 68 65 20 69 6e 64 | 69 63 61 74 65 64 20 7b | the ind|icated {|
|00001c40| 5c 65 6d 20 72 61 64 69 | 75 73 7d 2e 20 20 43 79 |\em radi|us}. Cy|
|00001c50| 6c 69 6e 64 65 72 73 20 | 61 72 65 20 72 65 6e 64 |linders |are rend|
|00001c60| 65 72 65 64 0d 0a 09 7b | 5c 65 6d 20 77 69 74 68 |ered...{|\em with|
|00001c70| 6f 75 74 7d 20 65 6e 64 | 63 61 70 73 2e 0d 0a 5c |out} end|caps...\|
|00001c80| 65 6e 64 7b 64 65 66 70 | 72 69 6d 7d 0d 0a 54 68 |end{defp|rim}..Th|
|00001c90| 65 20 63 79 6c 69 6e 64 | 65 72 27 73 20 61 78 69 |e cylind|er's axi|
|00001ca0| 73 20 64 65 66 69 6e 65 | 73 20 74 68 65 20 24 76 |s define|s the $v|
|00001cb0| 24 20 61 78 69 73 2e 20 | 20 54 68 65 20 24 75 24 |$ axis. | The $u$|
|00001cc0| 20 61 78 69 73 20 77 72 | 61 70 73 20 61 72 6f 75 | axis wr|aps arou|
|00001cd0| 6e 64 20 74 68 65 0d 0a | 63 79 6c 69 6e 64 65 72 |nd the..|cylinder|
|00001ce0| 2c 20 77 69 74 68 20 24 | 75 3d 30 24 20 64 65 70 |, with $|u=0$ dep|
|00001cf0| 65 6e 64 65 6e 74 20 75 | 70 6f 6e 20 74 68 65 20 |endent u|pon the |
|00001d00| 6f 72 69 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 74 |orientat|ion of t|
|00001d10| 68 65 20 63 79 6c 69 6e | 64 65 72 2e 0d 0a 0d 0a |he cylin|der.....|
|00001d20| 0d 0a 5c 62 65 67 69 6e | 7b 64 65 66 70 72 69 6d |..\begin|{defprim|
|00001d30| 7d 7b 63 6f 6e 65 7d 7b | 24 72 61 64 5f 7b 62 6f |}{cone}{|$rad_{bo|
|00001d40| 74 74 6f 6d 7d 24 20 5c | 65 76 65 63 7b 62 6f 74 |ttom}$ \|evec{bot|
|00001d50| 74 6f 6d 7d 20 24 72 61 | 64 5f 7b 74 6f 70 7d 24 |tom} $ra|d_{top}$|
|00001d60| 20 5c 65 76 65 63 7b 74 | 6f 70 7d 7d 0d 0a 09 43 | \evec{t|op}}...C|
|00001d70| 72 65 61 74 73 20 61 20 | 28 74 72 75 6e 63 61 74 |reats a |(truncat|
|00001d80| 65 64 29 20 63 6f 6e 65 | 20 74 68 61 74 20 65 78 |ed) cone| that ex|
|00001d90| 74 65 6e 64 73 20 66 72 | 6f 6d 20 5c 65 76 65 63 |tends fr|om \evec|
|00001da0| 7b 62 6f 74 74 6f 6d 7d | 20 74 6f 0d 0a 09 5c 65 |{bottom}| to...\e|
|00001db0| 76 65 63 7b 74 6f 70 7d | 2e 20 20 54 68 65 20 63 |vec{top}|. The c|
|00001dc0| 6f 6e 65 20 77 69 6c 6c | 20 68 61 76 65 20 61 20 |one will| have a |
|00001dd0| 72 61 64 69 75 73 20 6f | 66 20 24 72 61 64 5f 7b |radius o|f $rad_{|
|00001de0| 62 6f 74 74 6f 6d 7d 24 | 20 61 74 0d 0a 09 5c 65 |bottom}$| at...\e|
|00001df0| 76 65 63 7b 62 6f 74 74 | 6f 6d 7d 20 61 6e 64 20 |vec{bott|om} and |
|00001e00| 61 20 72 61 64 69 75 73 | 20 6f 66 20 24 72 61 64 |a radius| of $rad|
|00001e10| 5f 7b 74 6f 70 7d 24 20 | 61 74 20 5c 65 76 65 63 |_{top}$ |at \evec|
|00001e20| 7b 74 6f 70 7d 2e 0d 0a | 09 43 6f 6e 65 73 20 61 |{top}...|.Cones a|
|00001e30| 72 65 20 72 65 6e 64 65 | 72 65 64 20 7b 5c 65 6d |re rende|red {\em|
|00001e40| 20 77 69 74 68 6f 75 74 | 7d 20 65 6e 64 63 61 70 | without|} endcap|
|00001e50| 73 2e 0d 0a 5c 65 6e 64 | 7b 64 65 66 70 72 69 6d |s...\end|{defprim|
|00001e60| 7d 0d 0a 43 6f 6e 65 20 | 69 6e 76 65 72 73 65 20 |}..Cone |inverse |
|00001e70| 6d 61 70 70 69 6e 67 20 | 69 73 20 61 6e 61 6c 6f |mapping |is analo|
|00001e80| 67 6f 75 73 20 74 6f 20 | 63 79 6c 69 6e 64 65 72 |gous to |cylinder|
|00001e90| 20 6d 61 70 70 69 6e 67 | 2e 0d 0a 0d 0a 5c 62 65 | mapping|.....\be|
|00001ea0| 67 69 6e 7b 64 65 66 70 | 72 69 6d 7d 7b 64 69 73 |gin{defp|rim}{dis|
|00001eb0| 63 7d 7b 7b 5c 65 6d 20 | 72 61 64 69 75 73 7d 20 |c}{{\em |radius} |
|00001ec0| 5c 65 76 65 63 7b 70 6f | 73 7d 20 5c 65 76 65 63 |\evec{po|s} \evec|
|00001ed0| 7b 6e 6f 72 6d 61 6c 7d | 7d 0d 0a 09 43 72 65 61 |{normal}|}...Crea|
|00001ee0| 74 65 73 20 61 20 64 69 | 73 63 20 63 65 6e 74 65 |tes a di|sc cente|
|00001ef0| 72 65 64 20 61 74 20 74 | 68 65 20 67 69 76 65 6e |red at t|he given|
|00001f00| 20 70 6f 73 69 74 69 6f | 6e 20 61 6e 64 20 77 69 | positio|n and wi|
|00001f10| 74 68 20 74 68 65 0d 0a | 09 69 6e 64 69 63 61 74 |th the..|.indicat|
|00001f20| 65 64 20 73 75 72 66 61 | 63 65 20 6e 6f 72 6d 61 |ed surfa|ce norma|
|00001f30| 6c 2e 0d 0a 5c 65 6e 64 | 7b 64 65 66 70 72 69 6d |l...\end|{defprim|
|00001f40| 7d 0d 0a 44 69 73 63 73 | 20 61 72 65 20 75 73 65 |}..Discs| are use|
|00001f50| 66 75 6c 20 66 6f 72 20 | 70 6c 61 63 69 6e 67 0d |ful for |placing.|
|00001f60| 0a 65 6e 64 63 61 70 73 | 20 6f 6e 20 63 79 6c 69 |.endcaps| on cyli|
|00001f70| 6e 64 65 72 73 20 61 6e | 64 20 63 6f 6e 65 73 2e |nders an|d cones.|
|00001f80| 0d 0a 49 6e 76 65 72 73 | 65 20 6d 61 70 70 69 6e |..Invers|e mappin|
|00001f90| 67 20 66 6f 72 20 74 68 | 65 20 64 69 73 63 20 69 |g for th|e disc i|
|00001fa0| 73 20 62 61 73 65 64 20 | 6f 6e 20 74 68 65 20 63 |s based |on the c|
|00001fb0| 6f 6d 70 75 74 61 74 69 | 6f 6e 20 6f 66 20 74 68 |omputati|on of th|
|00001fc0| 65 0d 0a 6e 6f 72 6d 61 | 6c 69 7a 65 64 20 70 6f |e..norma|lized po|
|00001fd0| 6c 61 72 20 63 6f 6f 72 | 64 69 6e 61 74 65 73 20 |lar coor|dinates |
|00001fe0| 6f 66 20 74 68 65 20 70 | 6f 69 6e 74 20 6f 66 20 |of the p|oint of |
|00001ff0| 69 6e 74 65 72 73 65 63 | 74 69 6f 6e 2e 20 20 54 |intersec|tion. T|
|00002000| 68 65 0d 0a 6e 6f 72 6d | 61 6c 69 7a 65 64 20 72 |he..norm|alized r|
|00002010| 61 64 69 75 73 0d 0a 6f | 66 20 74 68 65 20 70 6f |adius..o|f the po|
|00002020| 69 6e 74 20 6f 66 20 69 | 6e 74 65 72 73 65 63 74 |int of i|ntersect|
|00002030| 69 6f 6e 20 69 73 20 61 | 73 73 69 67 6e 65 64 20 |ion is a|ssigned |
|00002040| 74 6f 20 24 75 24 2c 20 | 77 68 69 6c 65 20 74 68 |to $u$, |while th|
|00002050| 65 20 6e 6f 72 6d 61 6c | 69 7a 65 64 20 61 6e 67 |e normal|ized ang|
|00002060| 6c 65 0d 0a 66 72 6f 6d | 20 61 20 72 65 66 65 72 |le..from| a refer|
|00002070| 65 6e 63 65 20 76 65 63 | 74 6f 72 20 69 73 20 61 |ence vec|tor is a|
|00002080| 73 73 69 67 6e 65 64 20 | 74 6f 20 24 76 24 2e 0d |ssigned |to $v$..|
|00002090| 0a 0d 0a 5c 73 65 63 74 | 69 6f 6e 7b 41 67 67 72 |...\sect|ion{Aggr|
|000020a0| 65 67 61 74 65 20 4f 62 | 6a 65 63 74 73 7d 0d 0a |egate Ob|jects}..|
|000020b0| 0d 0a 41 6e 20 61 67 67 | 72 65 67 61 74 65 20 69 |..An agg|regate i|
|000020c0| 73 20 61 20 63 6f 6c 6c | 65 63 74 69 6f 6e 20 6f |s a coll|ection o|
|000020d0| 66 20 70 72 69 6d 69 74 | 69 76 65 73 2c 20 61 67 |f primit|ives, ag|
|000020e0| 67 72 65 67 61 74 65 2c | 20 61 6e 64 20 43 53 47 |gregate,| and CSG|
|000020f0| 0d 0a 6f 62 6a 65 63 74 | 73 2e 20 20 41 6e 20 61 |..object|s. An a|
|00002100| 67 67 72 65 67 61 74 65 | 2c 20 6f 6e 63 65 20 64 |ggregate|, once d|
|00002110| 65 66 69 6e 65 64 2c 20 | 6d 61 79 20 62 65 20 69 |efined, |may be i|
|00002120| 6e 73 74 61 6e 74 69 61 | 74 65 64 20 61 74 20 77 |nstantia|ted at w|
|00002130| 69 6c 6c 2c 0d 0a 77 68 | 69 63 68 20 6d 65 61 6e |ill,..wh|ich mean|
|00002140| 73 20 74 68 61 74 0d 0a | 63 6f 70 69 65 73 20 74 |s that..|copies t|
|00002150| 68 61 74 20 61 72 65 20 | 6f 70 74 69 6f 6e 61 6c |hat are |optional|
|00002160| 6c 79 20 74 72 61 6e 73 | 66 6f 72 6d 65 64 20 61 |ly trans|formed a|
|00002170| 6e 64 20 74 65 78 74 75 | 72 65 64 20 6d 61 79 20 |nd textu|red may |
|00002180| 62 65 20 6d 61 64 65 2e | 0d 0a 49 66 20 61 20 73 |be made.|..If a s|
|00002190| 63 65 6e 65 20 63 61 6c | 6c 73 20 66 6f 72 20 74 |cene cal|ls for t|
|000021a0| 68 65 20 70 72 65 73 65 | 6e 63 65 20 6f 66 20 6d |he prese|nce of m|
|000021b0| 61 6e 79 20 67 65 6f 6d | 65 74 72 69 63 61 6c 6c |any geom|etricall|
|000021c0| 79 20 69 64 65 6e 74 69 | 63 61 6c 0d 0a 6f 62 6a |y identi|cal..obj|
|000021d0| 65 63 74 73 2c 20 6f 6e | 6c 79 20 6f 6e 65 20 73 |ects, on|ly one s|
|000021e0| 75 63 68 20 6f 62 6a 65 | 63 74 20 6e 65 65 64 20 |uch obje|ct need |
|000021f0| 62 65 20 64 65 66 69 6e | 65 64 3b 20 74 68 65 20 |be defin|ed; the |
|00002200| 6f 6e 65 20 64 65 66 69 | 6e 65 64 20 6f 62 6a 65 |one defi|ned obje|
|00002210| 63 74 0d 0a 6d 61 79 20 | 74 68 65 6e 20 62 65 20 |ct..may |then be |
|00002220| 69 6e 73 74 61 6e 74 69 | 61 74 65 64 20 6d 61 6e |instanti|ated man|
|00002230| 79 20 74 69 6d 65 73 2e | 0d 0a 0d 0a 41 6e 20 61 |y times.|....An a|
|00002240| 67 67 72 65 67 61 74 65 | 20 69 73 20 6f 6e 65 20 |ggregate| is one |
|00002250| 6f 66 20 73 65 76 65 72 | 61 6c 20 70 6f 73 73 69 |of sever|al possi|
|00002260| 62 6c 65 20 74 79 70 65 | 73 2e 20 20 54 68 65 73 |ble type|s. Thes|
|00002270| 65 20 61 67 67 72 65 67 | 61 74 65 20 74 79 70 65 |e aggreg|ate type|
|00002280| 73 0d 0a 61 72 65 20 64 | 69 66 66 65 72 65 6e 74 |s..are d|ifferent|
|00002290| 69 61 74 65 64 20 62 79 | 20 74 68 65 20 74 79 70 |iated by| the typ|
|000022a0| 65 20 6f 66 20 72 61 79 | 2f 61 67 67 72 65 67 61 |e of ray|/aggrega|
|000022b0| 74 65 20 69 6e 74 65 72 | 73 65 63 74 69 6f 6e 20 |te inter|section |
|000022c0| 61 6c 67 6f 72 69 74 68 | 6d 0d 0a 28 6f 66 74 65 |algorith|m..(ofte|
|000022d0| 6e 20 74 65 72 6d 65 64 | 20 61 6e 20 7b 5c 65 6d |n termed| an {\em|
|000022e0| 20 61 63 63 65 6c 65 72 | 61 74 69 6f 6e 20 74 65 | acceler|ation te|
|000022f0| 63 68 6e 69 71 75 65 7d | 20 6f 72 20 7b 5c 65 6d |chnique}| or {\em|
|00002300| 20 65 66 66 69 63 69 65 | 6e 63 79 20 73 63 68 65 | efficie|ncy sche|
|00002310| 6d 65 7d 29 0d 0a 74 68 | 61 74 20 69 73 20 75 73 |me})..th|at is us|
|00002320| 65 64 2e 0d 0a 0d 0a 41 | 67 67 72 65 67 61 74 65 |ed.....A|ggregate|
|00002330| 73 20 61 72 65 20 64 65 | 66 69 6e 65 64 20 62 79 |s are de|fined by|
|00002340| 20 67 69 76 69 6e 67 20 | 61 20 6b 65 79 77 6f 72 | giving |a keywor|
|00002350| 64 20 74 68 61 74 20 64 | 65 66 69 6e 65 73 20 74 |d that d|efines t|
|00002360| 68 65 0d 0a 74 79 70 65 | 20 6f 66 20 74 68 65 20 |he..type| of the |
|00002370| 61 67 67 72 65 67 61 74 | 65 2c 20 66 6f 6c 6c 6f |aggregat|e, follo|
|00002380| 77 65 64 20 62 79 0d 0a | 61 20 73 65 72 69 65 73 |wed by..|a series|
|00002390| 20 6f 66 20 6f 62 6a 65 | 63 74 20 69 6e 73 74 61 | of obje|ct insta|
|000023a0| 6e 74 69 61 74 69 6f 6e | 73 20 61 6e 64 0d 0a 73 |ntiation|s and..s|
|000023b0| 75 72 66 61 63 65 20 64 | 65 66 69 6e 69 74 69 6f |urface d|efinitio|
|000023c0| 6e 73 2c 20 61 6e 64 20 | 74 65 72 6d 69 6e 61 74 |ns, and |terminat|
|000023d0| 65 64 20 75 73 69 6e 67 | 20 74 68 65 20 7b 5c 74 |ed using| the {\t|
|000023e0| 74 20 65 6e 64 7d 20 6b | 65 79 77 6f 72 64 2e 0d |t end} k|eyword..|
|000023f0| 0a 49 66 20 61 20 64 65 | 66 69 6e 65 64 20 6f 62 |.If a de|fined ob|
|00002400| 6a 65 63 74 20 63 6f 6e | 74 61 69 6e 73 20 6e 6f |ject con|tains no|
|00002410| 20 69 6e 73 74 61 6e 74 | 69 61 74 69 6f 6e 73 2c | instant|iations,|
|00002420| 20 61 20 77 61 72 6e 69 | 6e 67 20 6d 65 73 73 61 | a warni|ng messa|
|00002430| 67 65 0d 0a 69 73 20 70 | 72 69 6e 74 65 64 2e 0d |ge..is p|rinted..|
|00002440| 0a 0d 0a 54 68 65 20 6d | 6f 73 74 20 62 61 73 69 |...The m|ost basi|
|00002450| 63 20 74 79 70 65 20 6f | 66 20 61 67 67 72 65 67 |c type o|f aggreg|
|00002460| 61 74 65 2c 20 74 68 65 | 20 7b 5c 65 6d 20 6c 69 |ate, the| {\em li|
|00002470| 73 74 7d 2c 20 70 65 72 | 66 6f 72 6d 73 0d 0a 69 |st}, per|forms..i|
|00002480| 6e 74 65 72 73 65 63 74 | 69 6f 6e 20 74 65 73 74 |ntersect|ion test|
|00002490| 69 6e 67 20 69 6e 20 74 | 68 65 20 73 69 6d 70 6c |ing in t|he simpl|
|000024a0| 65 73 74 20 70 6f 73 73 | 69 62 6c 65 20 77 61 79 |est poss|ible way|
|000024b0| 3a 20 20 45 61 63 68 20 | 6f 62 6a 65 63 74 20 69 |: Each |object i|
|000024c0| 6e 20 74 68 65 0d 0a 6c | 69 73 74 20 69 73 20 74 |n the..l|ist is t|
|000024d0| 65 73 74 65 64 20 66 6f | 72 20 69 6e 74 65 72 73 |ested fo|r inters|
|000024e0| 65 63 74 69 6f 6e 20 77 | 69 74 68 20 74 68 65 20 |ection w|ith the |
|000024f0| 72 61 79 20 69 6e 20 74 | 75 72 6e 2c 20 61 6e 64 |ray in t|urn, and|
|00002500| 20 74 68 65 20 63 6c 6f | 73 65 73 74 0d 0a 69 6e | the clo|sest..in|
|00002510| 74 65 72 73 65 63 74 69 | 6f 6e 20 69 73 20 72 65 |tersecti|on is re|
|00002520| 74 75 72 6e 65 64 2e 0d | 0a 0d 0a 5c 62 65 67 69 |turned..|...\begi|
|00002530| 6e 7b 64 65 66 6b 65 79 | 7d 7b 6c 69 73 74 7d 7b |n{defkey|}{list}{|
|00002540| 5c 6c 64 6f 74 73 20 7b | 5c 74 74 20 65 6e 64 7d |\ldots {|\tt end}|
|00002550| 7d 0d 0a 09 43 72 65 61 | 74 65 20 61 20 4c 69 73 |}...Crea|te a Lis|
|00002560| 74 20 6f 62 6a 65 63 74 | 20 63 6f 6e 74 61 69 6e |t object| contain|
|00002570| 69 6e 67 20 74 68 6f 73 | 65 20 6f 62 6a 65 63 74 |ing thos|e object|
|00002580| 73 20 69 6e 73 74 61 6e | 74 69 61 74 65 64 20 62 |s instan|tiated b|
|00002590| 65 74 77 65 65 6e 0d 0a | 09 74 68 65 20 7b 5c 74 |etween..|.the {\t|
|000025a0| 74 20 6c 69 73 74 7d 2f | 7b 5c 74 74 20 65 6e 64 |t list}/|{\tt end|
|000025b0| 7d 20 70 61 69 72 2e 0d | 0a 5c 65 6e 64 7b 64 65 |} pair..|.\end{de|
|000025c0| 66 6b 65 79 7d 0d 0a 0d | 0a 54 68 65 20 7b 5c 65 |fkey}...|.The {\e|
|000025d0| 6d 20 67 72 69 64 7d 20 | 61 67 67 72 65 67 61 74 |m grid} |aggregat|
|000025e0| 65 0d 0a 64 69 76 69 64 | 65 73 20 74 68 65 20 72 |e..divid|es the r|
|000025f0| 65 67 69 6f 6e 20 6f 66 | 20 73 70 61 63 65 20 69 |egion of| space i|
|00002600| 74 20 6f 63 63 75 70 69 | 65 73 20 69 6e 74 6f 20 |t occupi|es into |
|00002610| 61 20 6e 75 6d 62 65 72 | 20 6f 66 20 64 69 73 63 |a number| of disc|
|00002620| 72 65 74 65 0d 0a 62 6f | 78 2d 73 68 61 70 65 64 |rete..bo|x-shaped|
|00002630| 0d 0a 76 6f 78 65 6c 73 | 2e 20 20 45 61 63 68 20 |..voxels|. Each |
|00002640| 6f 66 20 74 68 65 73 65 | 20 76 6f 78 65 6c 73 20 |of these| voxels |
|00002650| 63 6f 6e 74 61 69 6e 73 | 20 61 20 6c 69 73 74 20 |contains| a list |
|00002660| 6f 66 20 74 68 65 20 6f | 62 6a 65 63 74 73 20 74 |of the o|bjects t|
|00002670| 68 61 74 0d 0a 69 6e 74 | 65 72 73 65 63 74 20 74 |hat..int|ersect t|
|00002680| 68 65 20 76 6f 78 65 6c | 2e 20 20 54 68 69 73 20 |he voxel|. This |
|00002690| 64 69 73 63 72 65 74 69 | 7a 61 74 69 6f 6e 20 6d |discreti|zation m|
|000026a0| 61 6b 65 73 20 69 74 20 | 70 6f 73 73 69 62 6c 65 |akes it |possible|
|000026b0| 20 74 6f 0d 0a 72 65 73 | 74 72 69 63 74 20 74 68 | to..res|trict th|
|000026c0| 65 20 6f 62 6a 65 63 74 | 73 0d 0a 74 65 73 74 65 |e object|s..teste|
|000026d0| 64 20 66 6f 72 20 69 6e | 74 65 72 73 65 63 74 69 |d for in|tersecti|
|000026e0| 6f 6e 20 74 6f 20 74 68 | 6f 73 65 20 74 68 61 74 |on to th|ose that|
|000026f0| 20 61 72 65 20 6c 69 6b | 65 6c 79 20 74 6f 20 68 | are lik|ely to h|
|00002700| 69 74 20 74 68 65 20 72 | 61 79 2c 0d 0a 61 6e 64 |it the r|ay,..and|
|00002710| 20 74 6f 20 74 65 73 74 | 0d 0a 74 68 65 20 6f 62 | to test|..the ob|
|00002720| 6a 65 63 74 73 20 69 6e | 20 6e 65 61 72 6c 79 20 |jects in| nearly |
|00002730| 60 60 63 6c 6f 73 65 73 | 74 2d 66 69 72 73 74 27 |``closes|t-first'|
|00002740| 27 20 6f 72 64 65 72 2e | 0d 0a 0d 0a 5c 62 65 67 |' order.|....\beg|
|00002750| 69 6e 7b 64 65 66 6b 65 | 79 7d 7b 67 72 69 64 7d |in{defke|y}{grid}|
|00002760| 7b 7b 5c 65 6d 20 78 76 | 6f 78 20 79 76 6f 78 20 |{{\em xv|ox yvox |
|00002770| 7a 76 6f 78 7d 20 5c 6c | 64 6f 74 73 20 7b 5c 74 |zvox} \l|dots {\t|
|00002780| 74 20 65 6e 64 7d 7d 0d | 0a 09 43 72 65 61 74 65 |t end}}.|..Create|
|00002790| 20 61 20 47 72 69 64 20 | 6f 62 6a 65 63 74 73 20 | a Grid |objects |
|000027a0| 63 6f 6d 70 6f 73 65 64 | 20 6f 66 20 7b 5c 65 6d |composed| of {\em|
|000027b0| 20 78 76 6f 78 7d 20 62 | 79 20 7b 5c 65 6d 20 79 | xvox} b|y {\em y|
|000027c0| 76 6f 78 7d 20 62 79 0d | 0a 09 7b 5c 65 6d 20 7a |vox} by.|..{\em z|
|000027d0| 76 6f 78 7d 20 76 6f 78 | 65 6c 73 20 63 6f 6e 74 |vox} vox|els cont|
|000027e0| 61 69 6e 69 6e 67 20 74 | 68 6f 73 65 20 6f 62 6a |aining t|hose obj|
|000027f0| 65 63 74 73 0d 0a 09 69 | 6e 73 74 61 6e 74 69 61 |ects...i|nstantia|
|00002800| 74 65 64 20 62 65 74 77 | 65 65 6e 20 74 68 65 20 |ted betw|een the |
|00002810| 7b 5c 74 74 20 67 72 69 | 64 7d 2f 7b 5c 74 74 20 |{\tt gri|d}/{\tt |
|00002820| 65 6e 64 7d 20 70 61 69 | 72 2e 0d 0a 5c 65 6e 64 |end} pai|r...\end|
|00002830| 7b 64 65 66 6b 65 79 7d | 0d 0a 49 74 20 69 73 20 |{defkey}|..It is |
|00002840| 75 73 75 61 6c 6c 79 20 | 6f 6e 6c 79 20 77 6f 72 |usually |only wor|
|00002850| 74 68 77 68 69 6c 65 20 | 74 6f 20 60 60 65 6e 67 |thwhile |to ``eng|
|00002860| 72 69 64 27 27 20 72 61 | 74 68 65 72 20 6c 61 72 |rid'' ra|ther lar|
|00002870| 67 65 2c 0d 0a 63 6f 6d | 70 6c 65 78 20 63 6f 6c |ge,..com|plex col|
|00002880| 6c 65 63 74 69 6f 6e 73 | 20 6f 66 20 6f 62 6a 65 |lections| of obje|
|00002890| 63 74 73 2e 20 20 47 72 | 69 64 73 20 61 6c 73 6f |cts. Gr|ids also|
|000028a0| 20 75 73 65 20 61 20 67 | 72 65 61 74 20 64 65 61 | use a g|reat dea|
|000028b0| 6c 20 6d 6f 72 65 0d 0a | 6d 65 6d 6f 72 79 20 74 |l more..|memory t|
|000028c0| 68 61 6e 20 4c 69 73 74 | 20 6f 62 6a 65 63 74 73 |han List| objects|
|000028d0| 2e 0d 0a 0d 0a 5c 73 65 | 63 74 69 6f 6e 20 7b 43 |.....\se|ction {C|
|000028e0| 6f 6e 73 74 72 75 63 74 | 69 76 65 20 53 6f 6c 69 |onstruct|ive Soli|
|000028f0| 64 20 47 65 6f 6d 65 74 | 72 79 7d 0d 0a 0d 0a 43 |d Geomet|ry}....C|
|00002900| 6f 6e 73 74 72 75 63 74 | 69 76 65 20 53 6f 6c 69 |onstruct|ive Soli|
|00002910| 64 20 47 65 6f 6d 65 74 | 72 79 20 69 73 0d 0a 74 |d Geomet|ry is..t|
|00002920| 68 65 20 70 72 6f 63 65 | 73 73 20 6f 66 20 62 75 |he proce|ss of bu|
|00002930| 69 6c 64 69 6e 67 20 73 | 6f 6c 69 64 20 6f 62 6a |ilding s|olid obj|
|00002940| 65 63 74 73 20 66 72 6f | 6d 20 6f 74 68 65 72 20 |ects fro|m other |
|00002950| 73 6f 6c 69 64 73 2e 0d | 0a 54 68 65 20 74 68 72 |solids..|.The thr|
|00002960| 65 65 20 43 53 47 0d 0a | 6f 70 65 72 61 74 6f 72 |ee CSG..|operator|
|00002970| 73 20 61 72 65 20 55 6e | 69 6f 6e 2c 20 49 6e 74 |s are Un|ion, Int|
|00002980| 65 72 73 65 63 74 69 6f | 6e 2c 20 61 6e 64 20 44 |ersectio|n, and D|
|00002990| 69 66 66 65 72 65 6e 63 | 65 2e 20 20 45 61 63 68 |ifferenc|e. Each|
|000029a0| 20 6f 70 65 72 61 74 6f | 72 0d 0a 61 63 74 73 20 | operato|r..acts |
|000029b0| 75 70 6f 6e 20 74 77 6f | 20 6f 62 6a 65 63 74 73 |upon two| objects|
|000029c0| 20 61 6e 64 20 70 72 6f | 64 75 63 65 73 20 61 20 | and pro|duces a |
|000029d0| 73 69 6e 67 6c 65 20 6f | 62 6a 65 63 74 20 72 65 |single o|bject re|
|000029e0| 73 75 6c 74 2e 0d 0a 42 | 79 20 63 6f 6d 62 69 6e |sult...B|y combin|
|000029f0| 69 6e 67 20 6d 75 6c 74 | 69 70 6c 65 20 6c 65 76 |ing mult|iple lev|
|00002a00| 65 6c 73 20 6f 66 20 43 | 53 47 20 6f 70 65 72 61 |els of C|SG opera|
|00002a10| 74 6f 72 73 2c 20 63 6f | 6d 70 6c 65 78 0d 0a 6f |tors, co|mplex..o|
|00002a20| 62 6a 65 63 74 73 20 63 | 61 6e 20 62 65 20 70 72 |bjects c|an be pr|
|00002a30| 6f 64 75 63 65 64 20 66 | 72 6f 6d 20 73 69 6d 70 |oduced f|rom simp|
|00002a40| 6c 65 20 70 72 69 6d 69 | 74 69 76 65 73 2e 0d 0a |le primi|tives...|
|00002a50| 0d 0a 54 68 65 20 75 6e | 69 6f 6e 20 6f 66 20 74 |..The un|ion of t|
|00002a60| 77 6f 20 6f 62 6a 65 63 | 74 73 20 72 65 73 75 6c |wo objec|ts resul|
|00002a70| 74 73 20 69 6e 20 61 6e | 0d 0a 6f 62 6a 65 63 74 |ts in an|..object|
|00002a80| 20 74 68 61 74 20 65 6e | 63 6c 6f 73 65 73 20 74 | that en|closes t|
|00002a90| 68 65 20 73 70 61 63 65 | 20 6f 63 63 75 70 69 65 |he space| occupie|
|00002aa0| 64 20 62 79 20 74 68 65 | 20 74 77 6f 20 67 69 76 |d by the| two giv|
|00002ab0| 65 6e 20 6f 62 6a 65 63 | 74 73 2e 0d 0a 49 6e 74 |en objec|ts...Int|
|00002ac0| 65 72 73 65 63 74 69 6f | 6e 20 72 65 73 75 6c 74 |ersectio|n result|
|00002ad0| 73 20 69 6e 20 61 6e 20 | 6f 62 6a 65 63 74 20 74 |s in an |object t|
|00002ae0| 68 61 74 20 65 6e 63 6c | 6f 73 65 73 20 74 68 65 |hat encl|oses the|
|00002af0| 20 73 70 61 63 65 20 77 | 68 65 72 65 20 74 68 65 | space w|here the|
|00002b00| 20 74 77 6f 0d 0a 67 69 | 76 65 6e 20 6f 62 6a 65 | two..gi|ven obje|
|00002b10| 63 74 73 20 6f 76 65 72 | 6c 61 70 2e 20 20 44 69 |cts over|lap. Di|
|00002b20| 66 66 65 72 65 6e 63 65 | 20 69 73 20 61 6e 20 6f |fference| is an o|
|00002b30| 72 64 65 72 20 64 65 70 | 65 6e 64 65 6e 74 20 6f |rder dep|endent o|
|00002b40| 70 65 72 61 74 6f 72 3b | 20 69 74 0d 0a 72 65 73 |perator;| it..res|
|00002b50| 75 6c 74 73 20 69 6e 20 | 74 68 65 0d 0a 66 69 72 |ults in |the..fir|
|00002b60| 73 74 20 67 69 76 65 6e | 20 6f 62 6a 65 63 74 20 |st given| object |
|00002b70| 6d 69 6e 75 73 20 74 68 | 65 20 73 70 61 63 65 20 |minus th|e space |
|00002b80| 77 68 65 72 65 20 74 68 | 65 20 73 65 63 6f 6e 64 |where th|e second|
|00002b90| 20 69 6e 74 65 72 73 65 | 63 74 65 64 0d 0a 74 68 | interse|cted..th|
|00002ba0| 65 20 66 69 72 73 74 2e | 0d 0a 0d 0a 5c 73 75 62 |e first.|....\sub|
|00002bb0| 73 65 63 74 69 6f 6e 7b | 43 53 47 20 69 6e 20 7b |section{|CSG in {|
|00002bc0| 5c 52 61 79 73 68 61 64 | 65 7d 7d 0d 0a 0d 0a 43 |\Rayshad|e}}....C|
|00002bd0| 53 47 20 69 6e 20 7b 5c | 72 61 79 73 68 61 64 65 |SG in {\|rayshade|
|00002be0| 7d 20 77 69 6c 6c 20 67 | 65 6e 65 72 61 6c 6c 79 |} will g|enerally|
|00002bf0| 20 6f 70 65 72 61 74 65 | 20 70 72 6f 70 65 72 6c | operate| properl|
|00002c00| 79 20 77 68 65 6e 20 61 | 70 70 6c 69 65 64 20 74 |y when a|pplied t|
|00002c10| 6f 0d 0a 63 6f 6e 6a 75 | 6e 63 74 69 6f 6e 20 77 |o..conju|nction w|
|00002c20| 69 74 68 0d 0a 6f 6e 20 | 62 6f 78 65 73 2c 20 73 |ith..on |boxes, s|
|00002c30| 70 68 65 72 65 73 2c 0d | 0a 74 6f 72 69 2c 20 61 |pheres,.|.tori, a|
|00002c40| 6e 64 20 62 6c 6f 62 73 | 2e 0d 0a 54 68 65 73 65 |nd blobs|...These|
|00002c50| 20 70 72 69 6d 69 74 69 | 76 65 73 20 61 72 65 20 | primiti|ves are |
|00002c60| 62 79 20 6e 61 74 75 72 | 65 20 63 6f 6e 73 69 73 |by natur|e consis|
|00002c70| 74 65 6e 74 2c 20 61 73 | 20 74 68 65 79 20 61 6c |tent, as| they al|
|00002c80| 6c 0d 0a 65 6e 63 6c 6f | 73 65 20 61 20 70 6f 72 |l..enclo|se a por|
|00002c90| 74 69 6f 6e 20 6f 66 20 | 73 70 61 63 65 20 28 6e |tion of |space (n|
|00002ca0| 6f 20 68 6f 6c 65 20 66 | 72 6f 6d 20 74 68 65 20 |o hole f|rom the |
|00002cb0| 60 60 69 6e 73 69 64 65 | 27 27 20 74 6f 20 74 68 |``inside|'' to th|
|00002cc0| 65 0d 0a 60 60 6f 75 74 | 73 69 64 65 27 27 29 2c |e..``out|side''),|
|00002cd0| 20 68 61 76 65 20 73 75 | 72 66 61 63 65 20 6e 6f | have su|rface no|
|00002ce0| 72 6d 61 6c 73 20 77 68 | 69 63 68 20 70 6f 69 6e |rmals wh|ich poin|
|00002cf0| 74 20 6f 75 74 77 61 72 | 64 20 28 74 68 65 79 0d |t outwar|d (they.|
|00002d00| 0a 61 72 65 20 6e 6f 74 | 20 60 60 69 6e 73 69 64 |.are not| ``insid|
|00002d10| 65 2d 6f 75 74 27 27 29 | 2c 20 61 6e 64 20 64 6f |e-out'')|, and do|
|00002d20| 20 6e 6f 74 20 68 61 76 | 65 20 61 6e 79 20 65 78 | not hav|e any ex|
|00002d30| 74 72 61 6e 65 6f 75 73 | 20 73 75 72 66 61 63 65 |traneous| surface|
|00002d40| 73 2e 0d 0a 0d 0a 43 53 | 47 20 6f 62 6a 65 63 74 |s.....CS|G object|
|00002d50| 73 20 6d 61 79 20 61 6c | 73 6f 20 62 65 20 63 6f |s may al|so be co|
|00002d60| 6e 73 74 72 75 63 74 65 | 64 20 66 72 6f 6d 20 61 |nstructe|d from a|
|00002d70| 67 67 72 65 67 61 74 65 | 20 6f 62 6a 65 63 74 73 |ggregate| objects|
|00002d80| 2e 0d 0a 54 68 65 73 65 | 20 61 67 67 72 65 67 61 |...These| aggrega|
|00002d90| 74 65 73 20 63 6f 6e 74 | 61 69 6e 0d 0a 77 68 61 |tes cont|ain..wha|
|00002da0| 74 65 76 65 72 20 69 73 | 20 6c 69 73 74 65 64 20 |tever is| listed |
|00002db0| 69 6e 73 69 64 65 2c 20 | 61 6e 64 20 6d 61 79 20 |inside, |and may |
|00002dc0| 74 68 65 72 65 66 6f 72 | 65 20 62 65 20 69 6e 63 |therefor|e be inc|
|00002dd0| 6f 6e 73 69 73 74 65 6e | 74 2e 0d 0a 46 6f 72 20 |onsisten|t...For |
|00002de0| 65 78 61 6d 70 6c 65 2c | 20 61 6e 20 6f 62 6a 65 |example,| an obje|
|00002df0| 63 74 20 77 68 69 63 68 | 20 63 6f 6e 74 61 69 6e |ct which| contain|
|00002e00| 73 20 61 20 73 69 6e 67 | 6c 65 20 74 72 69 61 6e |s a sing|le trian|
|00002e10| 67 6c 65 20 77 69 6c 6c | 20 6e 6f 74 0d 0a 70 72 |gle will| not..pr|
|00002e20| 6f 64 75 63 65 20 63 6f | 72 72 65 63 74 20 72 65 |oduce co|rrect re|
|00002e30| 73 75 6c 74 73 20 69 6e | 20 43 53 47 20 6d 6f 64 |sults in| CSG mod|
|00002e40| 65 6c 73 2c 20 62 65 63 | 61 75 73 65 20 74 68 65 |els, bec|ause the|
|00002e50| 20 74 72 69 61 6e 67 6c | 65 20 64 6f 65 73 20 6e | triangl|e does n|
|00002e60| 6f 74 20 65 6e 63 6c 6f | 73 65 0d 0a 73 70 61 63 |ot enclo|se..spac|
|00002e70| 65 2e 20 20 48 6f 77 65 | 76 65 72 2c 20 61 20 63 |e. Howe|ver, a c|
|00002e80| 6f 6c 6c 65 63 74 69 6f | 6e 20 6f 66 20 66 6f 75 |ollectio|n of fou|
|00002e90| 72 20 74 72 69 61 6e 67 | 6c 65 73 20 77 68 69 63 |r triang|les whic|
|00002ea0| 68 20 66 6f 72 6d 20 61 | 20 70 79 72 61 6d 69 64 |h form a| pyramid|
|00002eb0| 0d 0a 64 6f 65 73 20 65 | 6e 63 6c 6f 73 65 20 73 |..does e|nclose s|
|00002ec0| 70 61 63 65 2c 20 61 6e | 64 20 69 66 20 74 68 65 |pace, an|d if the|
|00002ed0| 20 74 72 69 61 6e 67 6c | 65 20 6e 6f 72 6d 61 6c | triangl|e normal|
|00002ee0| 73 0d 0a 61 72 65 20 6f | 72 69 65 6e 74 65 64 20 |s..are o|riented |
|00002ef0| 63 6f 72 72 65 63 74 6c | 79 2c 0d 0a 74 68 65 20 |correctl|y,..the |
|00002f00| 43 53 47 20 6f 70 65 72 | 61 74 6f 72 73 20 73 68 |CSG oper|ators sh|
|00002f10| 6f 75 6c 64 20 77 6f 72 | 6b 20 63 6f 72 72 65 63 |ould wor|k correc|
|00002f20| 74 6c 79 20 6f 6e 20 74 | 68 65 20 70 79 72 61 6d |tly on t|he pyram|
|00002f30| 69 64 2e 0d 0a 0d 0a 43 | 53 47 20 6f 62 6a 65 63 |id.....C|SG objec|
|00002f40| 74 73 20 61 72 65 20 73 | 70 65 63 69 66 69 65 64 |ts are s|pecified|
|00002f50| 20 62 79 20 73 75 72 72 | 6f 75 6e 64 69 6e 67 20 | by surr|ounding |
|00002f60| 74 68 65 20 6f 62 6a 65 | 63 74 73 20 75 70 6f 6e |the obje|cts upon|
|00002f70| 0d 0a 77 68 69 63 68 20 | 74 6f 20 6f 70 65 72 61 |..which |to opera|
|00002f80| 74 65 2c 20 61 73 20 77 | 65 6c 6c 20 61 73 20 61 |te, as w|ell as a|
|00002f90| 6e 79 20 61 73 73 6f 63 | 69 61 74 65 64 20 73 75 |ny assoc|iated su|
|00002fa0| 72 66 61 63 65 2d 62 69 | 6e 64 69 6e 67 20 63 6f |rface-bi|nding co|
|00002fb0| 6d 6d 61 6e 64 73 2c 0d | 0a 62 79 20 74 68 65 20 |mmands,.|.by the |
|00002fc0| 6f 70 65 72 61 74 6f 72 | 20 76 65 72 62 20 6f 6e |operator| verb on|
|00002fd0| 20 6f 6e 65 20 73 69 64 | 65 20 61 6e 64 20 74 68 | one sid|e and th|
|00002fe0| 65 20 7b 5c 74 74 20 65 | 6e 64 7d 0d 0a 6b 65 79 |e {\tt e|nd}..key|
|00002ff0| 77 6f 72 64 20 6f 6e 20 | 74 68 65 20 6f 74 68 65 |word on |the othe|
|00003000| 72 3a 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 64 65 66 |r:....\b|egin{def|
|00003010| 6b 65 79 7d 7b 75 6e 69 | 6f 6e 7d 7b 24 3c 24 7b |key}{uni|on}{$<${|
|00003020| 5c 65 6d 20 4f 62 6a 65 | 63 74 7d 24 3e 24 20 24 |\em Obje|ct}$>$ $|
|00003030| 3c 24 7b 5c 65 6d 20 4f | 62 6a 65 63 74 7d 24 3e |<${\em O|bject}$>|
|00003040| 24 0d 0a 5b 24 3c 24 7b | 5c 65 6d 20 4f 62 6a 65 |$..[$<${|\em Obje|
|00003050| 63 74 7d 24 3e 24 20 5c | 6c 64 6f 74 73 5d 20 7b |ct}$>$ \|ldots] {|
|00003060| 5c 74 74 20 65 6e 64 7d | 7d 0d 0a 09 53 70 65 63 |\tt end}|}...Spec|
|00003070| 69 66 79 20 61 20 6e 65 | 77 20 6f 62 6a 65 63 74 |ify a ne|w object|
|00003080| 20 64 65 66 69 6e 65 64 | 20 61 73 20 74 68 65 20 | defined| as the |
|00003090| 75 6e 69 6f 6e 20 6f 66 | 20 74 68 65 0d 0a 09 67 |union of| the...g|
|000030a0| 69 76 65 6e 20 6f 62 6a | 65 63 74 73 2e 0d 0a 5c |iven obj|ects...\|
|000030b0| 65 6e 64 7b 64 65 66 6b | 65 79 7d 0d 0a 0d 0a 5c |end{defk|ey}....\|
|000030c0| 62 65 67 69 6e 7b 64 65 | 66 6b 65 79 7d 7b 64 69 |begin{de|fkey}{di|
|000030d0| 66 66 65 72 65 6e 63 65 | 7d 7b 24 3c 24 7b 5c 65 |fference|}{$<${\e|
|000030e0| 6d 20 4f 62 6a 65 63 74 | 7d 24 3e 24 20 24 3c 24 |m Object|}$>$ $<$|
|000030f0| 7b 5c 65 6d 20 4f 62 6a | 65 63 74 7d 24 3e 24 20 |{\em Obj|ect}$>$ |
|00003100| 0d 0a 5b 24 3c 24 7b 5c | 65 6d 20 4f 62 6a 65 63 |..[$<${\|em Objec|
|00003110| 74 7d 24 3e 24 20 5c 6c | 64 6f 74 73 5d 20 7b 5c |t}$>$ \l|dots] {\|
|00003120| 74 74 20 65 6e 64 7d 7d | 0d 0a 09 53 70 65 63 69 |tt end}}|...Speci|
|00003130| 66 79 20 61 20 6e 65 77 | 20 6f 62 6a 65 63 74 20 |fy a new| object |
|00003140| 64 65 66 69 6e 65 64 20 | 61 73 20 74 68 65 20 64 |defined |as the d|
|00003150| 69 66 66 65 72 65 6e 63 | 65 20 6f 66 20 74 68 65 |ifferenc|e of the|
|00003160| 0d 0a 09 67 69 76 65 6e | 20 6f 62 6a 65 63 74 73 |...given| objects|
|00003170| 2e 0d 0a 5c 65 6e 64 7b | 64 65 66 6b 65 79 7d 0d |...\end{|defkey}.|
|00003180| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 64 65 66 6b 65 79 |...\begi|n{defkey|
|00003190| 7d 7b 69 6e 74 65 72 73 | 65 63 74 7d 7b 24 3c 24 |}{inters|ect}{$<$|
|000031a0| 7b 5c 65 6d 20 4f 62 6a | 65 63 74 7d 24 3e 24 20 |{\em Obj|ect}$>$ |
|000031b0| 24 3c 24 7b 5c 65 6d 20 | 4f 62 6a 65 63 74 7d 24 |$<${\em |Object}$|
|000031c0| 3e 24 0d 0a 5b 24 3c 24 | 7b 5c 65 6d 20 4f 62 6a |>$..[$<$|{\em Obj|
|000031d0| 65 63 74 7d 24 3e 24 20 | 5c 6c 64 6f 74 73 5d 20 |ect}$>$ |\ldots] |
|000031e0| 7b 5c 74 74 20 65 6e 64 | 7d 7d 0d 0a 09 53 70 65 |{\tt end|}}...Spe|
|000031f0| 63 69 66 79 20 61 20 6e | 65 77 20 6f 62 6a 65 63 |cify a n|ew objec|
|00003200| 74 20 64 65 66 69 6e 65 | 64 20 61 73 20 74 68 65 |t define|d as the|
|00003210| 20 69 6e 74 65 72 73 65 | 63 74 69 6f 6e 20 6f 66 | interse|ction of|
|00003220| 20 74 68 65 0d 0a 09 67 | 69 76 65 6e 20 6f 62 6a | the...g|iven obj|
|00003230| 65 63 74 73 2e 0d 0a 5c | 65 6e 64 7b 64 65 66 6b |ects...\|end{defk|
|00003240| 65 79 7d 0d 0a 0d 0a 4e | 6f 74 65 20 74 68 61 74 |ey}....N|ote that|
|00003250| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 69 6d 70 | the cur|rent imp|
|00003260| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 64 6f 65 73 |lementat|ion does|
|00003270| 20 6e 6f 74 20 73 75 70 | 70 6f 72 74 20 6d 6f 72 | not sup|port mor|
|00003280| 65 20 74 68 61 74 20 74 | 77 6f 0d 0a 6f 62 6a 65 |e that t|wo..obje|
|00003290| 63 74 73 20 69 6e 20 61 | 20 43 53 47 20 6c 69 73 |cts in a| CSG lis|
|000032a0| 74 20 28 62 75 74 20 69 | 74 20 69 73 20 70 6c 61 |t (but i|t is pla|
|000032b0| 6e 6e 65 64 20 66 6f 72 | 20 61 20 66 75 74 75 72 |nned for| a futur|
|000032c0| 65 20 76 65 72 73 69 6f | 6e 29 2e 0d 0a 0d 0a 25 |e versio|n).....%|
|000032d0| 20 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 61 | The fol|lowing a|
|000032e0| 72 65 6e 20 73 69 6d 70 | 6c 65 20 43 53 47 20 6f |ren simp|le CSG o|
|000032f0| 62 6a 65 63 74 73 20 75 | 73 69 6e 67 20 74 68 65 |bjects u|sing the|
|00003300| 20 66 6f 75 72 20 63 6f | 6e 73 69 73 74 65 6e 74 | four co|nsistent|
|00003310| 0d 0a 25 20 70 72 69 6d | 69 74 69 76 65 73 3a 0d |..% prim|itives:.|
|00003320| 0a 25 20 0d 0a 25 20 75 | 6e 69 6f 6e 20 62 6f 78 |.% ..% u|nion box|
|00003330| 20 2e 2e 2e 20 64 69 66 | 66 65 72 65 6e 63 65 20 | ... dif|ference |
|00003340| 2e 2e 2e 0d 0a 0d 0a 5c | 73 75 62 73 65 63 74 69 |.......\|subsecti|
|00003350| 6f 6e 7b 50 6f 74 65 6e | 74 69 61 6c 20 43 53 47 |on{Poten|tial CSG|
|00003360| 20 50 72 6f 62 6c 65 6d | 73 7d 0d 0a 0d 0a 41 20 | Problem|s}....A |
|00003370| 63 6f 6e 73 69 73 74 65 | 6e 74 20 43 53 47 20 6d |consiste|nt CSG m|
|00003380| 6f 64 65 6c 20 69 73 20 | 6f 6e 65 20 77 68 69 63 |odel is |one whic|
|00003390| 68 20 69 73 20 6d 61 64 | 65 0d 0a 75 70 20 6f 66 |h is mad|e..up of|
|000033a0| 20 73 6f 6c 69 64 20 6f | 62 6a 65 63 74 73 20 77 | solid o|bjects w|
|000033b0| 69 74 68 20 6e 6f 20 64 | 61 6e 67 6c 69 6e 67 20 |ith no d|angling |
|000033c0| 73 75 72 66 61 63 65 73 | 2e 20 20 49 6e 20 7b 5c |surfaces|. In {\|
|000033d0| 72 61 79 73 68 61 64 65 | 7d 2c 0d 0a 69 74 20 69 |rayshade|},..it i|
|000033e0| 73 20 71 75 69 74 65 20 | 65 61 73 79 20 74 6f 20 |s quite |easy to |
|000033f0| 63 6f 6e 73 74 72 75 63 | 74 20 69 6e 63 6f 6e 73 |construc|t incons|
|00003400| 69 73 74 65 6e 74 20 6d | 6f 64 65 6c 73 2c 20 77 |istent m|odels, w|
|00003410| 68 69 63 68 20 77 69 6c | 6c 20 75 73 75 61 6c 6c |hich wil|l usuall|
|00003420| 79 0d 0a 61 70 70 65 61 | 72 20 69 6e 63 6f 72 72 |y..appea|r incorr|
|00003430| 65 63 74 20 69 6e 20 74 | 68 65 20 66 69 6e 61 6c |ect in t|he final|
|00003440| 20 69 6d 61 67 65 73 2e | 0d 0a 49 6e 20 7b 5c 72 | images.|..In {\r|
|00003450| 61 79 73 68 61 64 65 7d | 2c 20 43 53 47 20 69 73 |ayshade}|, CSG is|
|00003460| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 62 79 20 | impleme|nted by |
|00003470| 6d 61 69 6e 74 61 69 6e | 69 6e 67 0d 0a 74 68 65 |maintain|ing..the|
|00003480| 20 74 72 65 65 20 73 74 | 72 75 63 74 75 72 65 20 | tree st|ructure |
|00003490| 6f 66 20 74 68 65 20 43 | 53 47 20 6f 70 65 72 61 |of the C|SG opera|
|000034a0| 74 69 6f 6e 73 2e 20 20 | 54 68 69 73 20 74 72 65 |tions. |This tre|
|000034b0| 65 20 69 73 20 74 72 61 | 76 65 72 73 65 64 2c 0d |e is tra|versed,.|
|000034c0| 0a 61 6e 64 20 74 68 65 | 20 6f 70 65 72 61 74 6f |.and the| operato|
|000034d0| 72 73 20 74 68 65 72 65 | 69 6e 20 61 70 70 6c 69 |rs there|in appli|
|000034e0| 65 64 2c 20 6f 6e 20 61 | 20 70 65 72 2d 72 61 79 |ed, on a| per-ray|
|000034f0| 20 62 61 73 69 73 2e 0d | 0a 49 74 20 69 73 20 74 | basis..|.It is t|
|00003500| 68 65 72 65 66 6f 72 65 | 20 64 69 66 66 69 63 75 |herefore| difficu|
|00003510| 6c 74 20 74 6f 20 76 65 | 72 69 66 79 20 74 68 65 |lt to ve|rify the|
|00003520| 20 63 6f 6e 73 69 73 74 | 65 6e 63 79 20 6f 66 0d | consist|ency of.|
|00003530| 0a 74 68 65 20 6d 6f 64 | 65 6c 20 60 60 6f 6e 20 |.the mod|el ``on |
|00003540| 74 68 65 20 66 6c 79 2e | 27 27 0d 0a 0d 0a 4f 6e |the fly.|''....On|
|00003550| 65 20 63 6c 61 73 73 20 | 6f 66 20 43 53 47 20 70 |e class |of CSG p|
|00003560| 72 6f 62 6c 65 6d 73 20 | 6f 63 63 75 72 20 77 68 |roblems |occur wh|
|00003570| 65 6e 0d 0a 73 75 72 66 | 61 63 65 73 20 6f 66 20 |en..surf|aces of |
|00003580| 6f 62 6a 65 63 74 73 20 | 62 65 69 6e 67 20 6f 70 |objects |being op|
|00003590| 65 72 61 74 65 64 20 75 | 70 6f 6e 0d 0a 63 6f 69 |erated u|pon..coi|
|000035a0| 6e 63 69 64 65 2e 20 20 | 46 6f 72 20 65 78 61 6d |ncide. |For exam|
|000035b0| 70 6c 65 2c 20 77 68 65 | 6e 20 73 75 62 74 72 61 |ple, whe|n subtra|
|000035c0| 63 74 69 6e 67 20 61 20 | 62 6f 78 20 66 72 6f 6d |cting a |box from|
|000035d0| 20 61 6e 6f 74 68 65 72 | 20 62 6f 78 20 74 6f 20 | another| box to |
|000035e0| 6d 61 6b 65 20 61 0d 0a | 73 71 75 61 72 65 20 63 |make a..|square c|
|000035f0| 75 70 2c 20 74 68 65 20 | 72 65 73 75 6c 74 20 77 |up, the |result w|
|00003600| 69 6c 6c 20 62 65 20 77 | 72 6f 6e 67 20 69 66 20 |ill be w|rong if |
|00003610| 74 68 65 20 74 6f 70 73 | 20 6f 66 20 74 68 65 20 |the tops| of the |
|00003620| 74 77 6f 20 62 6f 78 65 | 73 0d 0a 63 6f 69 6e 63 |two boxe|s..coinc|
|00003630| 69 64 65 2e 20 20 54 6f | 20 63 6f 72 72 65 63 74 |ide. To| correct|
|00003640| 20 74 68 69 73 2c 20 74 | 68 65 20 69 6e 6e 65 72 | this, t|he inner|
|00003650| 20 62 6f 78 20 73 68 6f | 75 6c 64 20 62 65 20 6d | box sho|uld be m|
|00003660| 61 64 65 0d 0a 73 6c 69 | 67 68 74 6c 79 20 74 61 |ade..sli|ghtly ta|
|00003670| 6c 6c 65 72 20 74 68 61 | 6e 20 74 68 65 20 6f 75 |ller tha|n the ou|
|00003680| 74 65 72 20 62 6f 78 2e | 0d 0a 41 20 72 65 6c 61 |ter box.|..A rela|
|00003690| 74 65 64 20 70 72 6f 62 | 6c 65 6d 20 74 68 61 74 |ted prob|lem that|
|000036a0| 20 6d 75 73 74 20 62 65 | 0d 0a 61 76 6f 69 64 65 | must be|..avoide|
|000036b0| 64 20 6f 63 63 75 72 73 | 20 77 68 65 6e 20 74 77 |d occurs| when tw|
|000036c0| 6f 20 63 6f 69 6e 63 69 | 64 65 6e 74 20 73 75 72 |o coinci|dent sur|
|000036d0| 66 61 63 65 73 20 61 72 | 65 20 61 73 73 69 67 6e |faces ar|e assign|
|000036e0| 65 64 0d 0a 64 69 66 66 | 65 72 65 6e 74 20 73 75 |ed..diff|erent su|
|000036f0| 72 66 61 63 65 20 70 72 | 6f 70 65 72 74 69 65 73 |rface pr|operties|
|00003700| 2e 0d 0a 0d 0a 49 74 20 | 6d 61 79 20 73 65 65 6d |.....It |may seem|
|00003710| 20 74 68 61 74 20 74 68 | 65 20 75 6e 69 6f 6e 20 | that th|e union |
|00003720| 6f 70 65 72 61 74 6f 72 | 20 69 73 20 75 6e 6e 65 |operator| is unne|
|00003730| 63 65 73 73 61 72 79 2c | 20 73 69 6e 63 65 0d 0a |cessary,| since..|
|00003740| 6c 69 73 74 69 6e 67 20 | 74 77 6f 20 6f 62 6a 65 |listing |two obje|
|00003750| 63 74 73 20 74 6f 67 65 | 74 68 65 72 20 69 6e 20 |cts toge|ther in |
|00003760| 61 6e 20 61 67 67 72 65 | 67 61 74 65 20 72 65 73 |an aggre|gate res|
|00003770| 75 6c 74 73 0d 0a 69 6e | 20 61 6e 20 69 6d 61 67 |ults..in| an imag|
|00003780| 65 20 74 68 61 74 20 61 | 70 70 65 61 72 73 20 74 |e that a|ppears t|
|00003790| 6f 20 62 65 20 74 68 65 | 20 73 61 6d 65 2e 0d 0a |o be the| same...|
|000037a0| 57 68 69 6c 65 20 74 68 | 65 20 72 65 73 75 6c 74 |While th|e result|
|000037b0| 20 6f 66 20 73 75 63 68 | 20 61 20 73 68 6f 72 74 | of such| a short|
|000037c0| 2d 63 75 74 0d 0a 6d 61 | 79 20 61 70 70 65 61 72 |-cut..ma|y appear|
|000037d0| 20 74 68 65 20 73 61 6d | 65 20 6f 6e 20 74 68 65 | the sam|e on the|
|000037e0| 20 65 78 74 65 72 69 6f | 72 2c 20 74 68 65 20 69 | exterio|r, the i|
|000037f0| 6e 74 65 72 69 6f 72 0d | 0a 6f 66 20 74 68 65 20 |nterior.|.of the |
|00003800| 72 65 73 75 6c 74 69 6e | 67 20 6f 62 6a 65 63 74 |resultin|g object|
|00003810| 20 77 69 6c 6c 20 63 6f | 6e 74 61 69 6e 0d 0a 65 | will co|ntain..e|
|00003820| 78 74 72 61 6e 65 6f 75 | 73 20 73 75 72 66 61 63 |xtraneou|s surfac|
|00003830| 65 73 2e 0d 0a 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |es...The| followi|
|00003840| 6e 67 20 65 78 61 6d 70 | 6c 65 73 20 73 68 6f 77 |ng examp|les show|
|00003850| 20 74 68 69 73 20 71 75 | 69 74 65 20 63 6c 65 61 | this qu|ite clea|
|00003860| 72 6c 79 2e 0d 0a 0d 0a | 5c 62 65 67 69 6e 7b 76 |rly.....|\begin{v|
|00003870| 65 72 62 61 74 69 6d 7d | 0d 0a 20 20 20 20 64 69 |erbatim}|.. di|
|00003880| 66 66 65 72 65 6e 63 65 | 0d 0a 20 20 20 20 20 20 |fference|.. |
|00003890| 62 6f 78 20 2d 32 20 30 | 20 2d 33 20 20 32 20 33 |box -2 0| -3 2 3|
|000038a0| 20 33 0d 0a 20 20 20 20 | 20 20 75 6e 69 6f 6e 20 | 3.. | union |
|000038b0| 20 2f 2a 20 63 68 61 6e | 67 65 20 74 6f 20 6c 69 | /* chan|ge to li|
|000038c0| 73 74 3b 20 6e 6f 74 65 | 20 62 61 64 20 69 6e 74 |st; note| bad int|
|000038d0| 65 72 6e 61 6c 20 73 75 | 72 66 61 63 65 73 20 2a |ernal su|rfaces *|
|000038e0| 2f 0d 0a 20 20 20 20 20 | 20 20 20 73 70 68 65 72 |/.. | spher|
|000038f0| 65 20 32 20 31 20 30 20 | 30 0d 0a 20 20 20 20 20 |e 2 1 0 |0.. |
|00003900| 20 20 20 73 70 68 65 72 | 65 20 32 20 2d 31 20 30 | spher|e 2 -1 0|
|00003910| 20 30 0d 0a 20 20 20 20 | 20 20 65 6e 64 0d 0a 20 | 0.. | end.. |
|00003920| 20 20 20 65 6e 64 20 72 | 6f 74 61 74 65 20 31 20 | end r|otate 1 |
|00003930| 30 20 30 20 2d 34 30 20 | 20 72 6f 74 61 74 65 20 |0 0 -40 | rotate |
|00003940| 30 20 30 20 31 20 35 30 | 0d 0a 5c 65 6e 64 7b 76 |0 0 1 50|..\end{v|
|00003950| 65 72 62 61 74 69 6d 7d | 0d 0a 0d 0a 54 68 65 20 |erbatim}|....The |
|00003960| 76 69 73 75 61 6c 20 65 | 76 69 64 65 6e 63 65 20 |visual e|vidence |
|00003970| 6f 66 20 61 6e 20 69 6e | 63 6f 6e 73 69 73 74 65 |of an in|consiste|
|00003980| 6e 74 20 43 53 47 20 6f | 62 6a 65 63 74 20 76 61 |nt CSG o|bject va|
|00003990| 72 69 65 73 20 64 65 70 | 65 6e 64 69 6e 67 0d 0a |ries dep|ending..|
|000039a0| 75 70 6f 6e 20 74 68 65 | 20 6f 70 65 72 61 74 6f |upon the| operato|
|000039b0| 72 20 62 65 69 6e 67 20 | 75 73 65 64 2e 0d 0a 57 |r being |used...W|
|000039c0| 68 65 6e 20 73 75 62 74 | 72 61 63 74 69 6e 67 20 |hen subt|racting |
|000039d0| 61 20 63 6f 6e 73 69 73 | 74 65 6e 74 20 6f 62 6a |a consis|tent obj|
|000039e0| 65 63 74 20 66 72 6f 6d | 20 61 6e 64 0d 0a 69 6e |ect from| and..in|
|000039f0| 63 6f 6e 73 69 73 74 65 | 6e 74 20 6f 6e 65 2c 20 |consiste|nt one, |
|00003a00| 74 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 6f 62 |the resu|lting ob|
|00003a10| 6a 65 63 74 20 77 69 6c | 6c 20 61 70 70 65 61 72 |ject wil|l appear|
|00003a20| 20 74 6f 20 62 65 0d 0a | 74 68 65 20 75 6e 69 6f | to be..|the unio|
|00003a30| 6e 20 6f 66 20 74 68 65 | 20 74 77 6f 20 6f 62 6a |n of the| two obj|
|00003a40| 65 63 74 73 2c 20 62 75 | 74 20 74 68 65 20 73 68 |ects, bu|t the sh|
|00003a50| 61 64 69 6e 67 20 77 69 | 6c 6c 20 62 65 20 69 6e |ading wi|ll be in|
|00003a60| 63 6f 72 72 65 63 74 2e | 0d 0a 49 74 20 77 69 6c |correct.|..It wil|
|00003a70| 6c 20 61 70 70 65 61 72 | 20 74 6f 20 62 65 20 69 |l appear| to be i|
|00003a80| 6e 73 69 64 65 2d 6f 75 | 74 20 69 6e 20 70 6c 61 |nside-ou|t in pla|
|00003a90| 63 65 73 2c 20 77 68 69 | 6c 65 20 63 6f 72 72 65 |ces, whi|le corre|
|00003aa0| 63 74 0d 0a 69 6e 20 6f | 74 68 65 72 20 70 6c 61 |ct..in o|ther pla|
|00003ab0| 63 65 73 2e 20 20 54 68 | 65 20 69 6e 73 69 64 65 |ces. Th|e inside|
|00003ac0| 2d 6f 75 74 20 73 65 63 | 74 69 6f 6e 73 20 69 6e |-out sec|tions in|
|00003ad0| 64 69 63 61 74 65 20 74 | 68 65 20 61 72 65 61 73 |dicate t|he areas|
|00003ae0| 0d 0a 77 68 65 72 65 20 | 74 68 65 20 70 72 6f 62 |..where |the prob|
|00003af0| 6c 65 6d 73 20 6f 63 63 | 75 72 2e 0d 0a 53 75 63 |lems occ|ur...Suc|
|00003b00| 68 20 70 72 6f 62 6c 65 | 6d 73 20 61 72 65 20 6f |h proble|ms are o|
|00003b10| 66 74 65 6e 20 63 61 75 | 73 65 64 20 62 79 0d 0a |ften cau|sed by..|
|00003b20| 70 6f 6c 79 67 6f 6e 73 | 20 77 69 74 68 20 69 6e |polygons| with in|
|00003b30| 63 6f 72 72 65 63 74 6c | 79 20 73 70 65 63 69 66 |correctl|y specif|
|00003b40| 69 65 64 0d 0a 6e 6f 72 | 6d 61 6c 73 2c 20 6f 72 |ied..nor|mals, or|
|00003b50| 20 62 79 20 73 75 72 66 | 61 63 65 73 20 74 68 61 | by surf|aces tha|
|00003b60| 74 20 65 78 61 63 74 6c | 79 20 63 6f 69 6e 63 69 |t exactl|y coinci|
|00003b70| 64 65 20 28 77 68 69 63 | 68 0d 0a 61 70 70 65 61 |de (whic|h..appea|
|00003b80| 72 20 61 73 20 70 61 72 | 74 69 61 6c 20 60 60 53 |r as par|tial ``S|
|00003b90| 77 69 73 73 20 63 68 65 | 65 73 65 27 27 20 6f 62 |wiss che|ese'' ob|
|00003ba0| 6a 65 63 74 73 29 2e 0d | 0a 0d 0a 54 68 65 20 66 |jects)..|...The f|
|00003bb0| 6f 6c 6c 6f 77 69 6e 67 | 20 65 78 61 6d 70 6c 65 |ollowing| example|
|00003bc0| 20 69 6c 6c 75 73 74 72 | 61 74 65 73 20 61 6e 20 | illustr|ates an |
|00003bd0| 61 74 74 65 6d 70 74 20 | 74 6f 20 73 75 62 74 72 |attempt |to subtr|
|00003be0| 61 63 74 20 61 20 73 70 | 68 65 72 65 20 66 72 6f |act a sp|here fro|
|00003bf0| 6d 0d 0a 61 20 70 79 72 | 61 6d 69 64 20 64 65 66 |m..a pyr|amid def|
|00003c00| 69 6e 65 64 20 75 73 69 | 6e 67 20 61 6e 20 69 6e |ined usi|ng an in|
|00003c10| 63 6f 72 72 65 63 74 6c | 79 20 66 61 63 69 6e 67 |correctl|y facing|
|00003c20| 20 74 72 69 61 6e 67 6c | 65 2e 20 20 4e 6f 74 65 | triangl|e. Note|
|00003c30| 0d 0a 74 68 61 74 20 74 | 68 65 20 72 65 73 75 6c |..that t|he resul|
|00003c40| 74 69 6e 67 20 69 6d 61 | 67 65 20 6f 62 76 69 6f |ting ima|ge obvio|
|00003c50| 75 73 6c 79 20 70 6f 69 | 6e 74 73 20 74 6f 20 77 |usly poi|nts to w|
|00003c60| 68 69 63 68 20 74 72 69 | 61 6e 67 6c 65 20 69 73 |hich tri|angle is|
|00003c70| 0d 0a 72 65 76 65 72 73 | 65 64 2e 0d 0a 0d 0a 5c |..revers|ed.....\|
|00003c80| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0d |begin{ve|rbatim}.|
|00003c90| 0a 20 20 20 20 6e 61 6d | 65 20 70 79 72 61 6d 69 |. nam|e pyrami|
|00003ca0| 64 20 6c 69 73 74 0d 0a | 20 20 20 20 20 20 20 20 |d list..| |
|00003cb0| 74 72 69 61 6e 67 6c 65 | 20 31 20 30 20 30 20 20 |triangle| 1 0 0 |
|00003cc0| 30 20 31 20 30 20 20 30 | 20 30 20 31 0d 0a 20 20 |0 1 0 0| 0 1.. |
|00003cd0| 20 20 20 20 20 20 74 72 | 69 61 6e 67 6c 65 20 31 | tr|iangle 1|
|00003ce0| 20 30 20 30 20 20 30 20 | 30 20 30 20 20 30 20 31 | 0 0 0 |0 0 0 1|
|00003cf0| 20 30 0d 0a 20 20 20 20 | 20 20 20 20 74 72 69 61 | 0.. | tria|
|00003d00| 6e 67 6c 65 20 30 20 31 | 20 30 20 20 30 20 30 20 |ngle 0 1| 0 0 0 |
|00003d10| 30 20 20 30 20 30 20 31 | 0d 0a 20 20 20 20 20 20 |0 0 0 1|.. |
|00003d20| 20 20 74 72 69 61 6e 67 | 6c 65 20 30 20 30 20 31 | triang|le 0 0 1|
|00003d30| 20 20 31 20 30 20 30 20 | 20 30 20 30 20 30 20 20 | 1 0 0 | 0 0 0 |
|00003d40| 2f 2a 20 77 72 6f 6e 67 | 20 6f 72 64 65 72 20 2a |/* wrong| order *|
|00003d50| 2f 0d 0a 20 20 20 20 65 | 6e 64 0d 0a 0d 0a 20 20 |/.. e|nd.... |
|00003d60| 20 20 64 69 66 66 65 72 | 65 6e 63 65 0d 0a 20 20 | differ|ence.. |
|00003d70| 20 20 20 20 20 20 6f 62 | 6a 65 63 74 20 70 79 72 | ob|ject pyr|
|00003d80| 61 6d 69 64 20 73 63 61 | 6c 65 20 33 20 33 20 33 |amid sca|le 3 3 3|
|00003d90| 20 72 6f 74 61 74 65 20 | 30 20 30 20 31 20 34 35 | rotate |0 0 1 45|
|00003da0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 72 6f |.. | ro|
|00003db0| 74 61 74 65 20 31 20 30 | 20 30 20 2d 33 30 20 74 |tate 1 0| 0 -30 t|
|00003dc0| 72 61 6e 73 6c 61 74 65 | 20 30 20 2d 33 2e 35 20 |ranslate| 0 -3.5 |
|00003dd0| 30 0d 0a 20 20 20 20 20 | 20 20 20 73 70 68 65 72 |0.. | spher|
|00003de0| 65 20 32 2e 34 20 30 20 | 30 20 30 0d 0a 20 20 20 |e 2.4 0 |0 0.. |
|00003df0| 20 65 6e 64 0d 0a 5c 65 | 6e 64 7b 76 65 72 62 61 | end..\e|nd{verba|
|00003e00| 74 69 6d 7d 0d 0a 0d 0a | 42 79 20 64 65 66 61 75 |tim}....|By defau|
|00003e10| 6c 74 2c 20 63 79 6c 69 | 6e 64 65 72 73 20 61 6e |lt, cyli|nders an|
|00003e20| 64 20 63 6f 6e 65 73 20 | 64 6f 20 6e 6f 74 20 68 |d cones |do not h|
|00003e30| 61 76 65 20 65 6e 64 20 | 63 61 70 73 2c 20 61 6e |ave end |caps, an|
|00003e40| 64 20 74 68 75 73 0d 0a | 61 72 65 20 6e 6f 74 20 |d thus..|are not |
|00003e50| 63 6f 6e 73 69 73 74 65 | 6e 74 20 70 72 69 6d 69 |consiste|nt primi|
|00003e60| 74 69 76 65 73 2e 20 20 | 4f 6e 65 20 6d 75 73 74 |tives. |One must|
|00003e70| 20 75 73 75 61 6c 6c 79 | 0d 0a 61 64 64 20 65 6e | usually|..add en|
|00003e80| 64 63 61 70 73 20 62 79 | 20 6c 69 73 74 69 6e 67 |dcaps by| listing|
|00003e90| 20 74 68 65 0d 0a 63 79 | 6c 69 6e 64 65 72 20 6f | the..cy|linder o|
|00003ea0| 72 20 63 6f 6e 65 20 77 | 69 74 68 20 28 63 6f 72 |r cone w|ith (cor|
|00003eb0| 72 65 63 74 6c 79 2d 6f | 72 69 65 6e 74 65 64 29 |rectly-o|riented)|
|00003ec0| 20 65 6e 64 63 61 70 20 | 64 69 73 63 73 20 69 6e | endcap |discs in|
|00003ed0| 20 61 6e 20 61 67 67 72 | 65 67 61 74 65 2e 0d 0a | an aggr|egate...|
|00003ee0| 0d 0a 5c 73 65 63 74 69 | 6f 6e 20 7b 4e 61 6d 65 |..\secti|on {Name|
|00003ef0| 64 20 4f 62 6a 65 63 74 | 73 7d 0d 0a 0d 0a 41 20 |d Object|s}....A |
|00003f00| 6e 61 6d 65 20 6d 61 79 | 20 62 65 20 61 73 73 6f |name may| be asso|
|00003f10| 63 69 61 74 65 64 20 77 | 69 74 68 20 61 6e 79 20 |ciated w|ith any |
|00003f20| 70 72 69 6d 69 74 69 76 | 65 2c 20 61 67 67 72 65 |primitiv|e, aggre|
|00003f30| 67 61 74 65 2c 20 6f 72 | 20 43 53 47 0d 0a 6f 62 |gate, or| CSG..ob|
|00003f40| 6a 65 63 74 20 74 68 72 | 6f 75 67 68 20 74 68 65 |ject thr|ough the|
|00003f50| 20 75 73 65 20 6f 66 20 | 74 68 65 20 7b 5c 74 74 | use of |the {\tt|
|00003f60| 20 6e 61 6d 65 7d 0d 0a | 6b 65 79 77 6f 72 64 3a | name}..|keyword:|
|00003f70| 0d 0a 0d 0a 5c 62 65 67 | 69 6e 7b 64 65 66 6b 65 |....\beg|in{defke|
|00003f80| 79 7d 7b 6e 61 6d 65 7d | 7b 7b 5c 65 6d 20 6f 62 |y}{name}|{{\em ob|
|00003f90| 6a 6e 61 6d 65 7d 20 24 | 3c 24 7b 5c 65 6d 20 49 |jname} $|<${\em I|
|00003fa0| 6e 73 74 61 6e 63 65 5c | 2f 7d 24 3e 24 7d 0d 0a |nstance\|/}$>$}..|
|00003fb0| 09 41 73 73 6f 63 69 61 | 74 65 20 7b 5c 65 6d 20 |.Associa|te {\em |
|00003fc0| 6f 62 6a 6e 61 6d 65 7d | 20 77 69 74 68 20 74 68 |objname}| with th|
|00003fd0| 65 20 67 69 76 65 6e 20 | 6f 62 6a 65 63 74 2e 20 |e given |object. |
|00003fe0| 20 54 68 65 0d 0a 09 73 | 70 65 63 69 66 69 65 64 | The...s|pecified|
|00003ff0| 20 6f 62 6a 65 63 74 20 | 69 73 20 6e 6f 74 20 61 | object |is not a|
|00004000| 63 74 75 61 6c 6c 79 20 | 69 6e 73 74 61 6e 74 69 |ctually |instanti|
|00004010| 61 74 65 64 3b 20 69 74 | 0d 0a 09 69 73 20 6f 6e |ated; it|...is on|
|00004020| 6c 79 20 73 74 6f 72 65 | 64 20 75 6e 64 65 72 20 |ly store|d under |
|00004030| 74 68 65 20 67 69 76 65 | 6e 20 6e 61 6d 65 2e 0d |the give|n name..|
|00004040| 0a 5c 65 6e 64 7b 64 65 | 66 6b 65 79 7d 0d 0a 0d |.\end{de|fkey}...|
|00004050| 0a 41 6e 20 6f 62 6a 65 | 63 74 20 74 68 75 73 20 |.An obje|ct thus |
|00004060| 6e 61 6d 65 64 20 6d 61 | 79 20 74 68 65 6e 20 62 |named ma|y then b|
|00004070| 65 20 69 6e 73 74 61 6e | 74 69 61 74 65 64 20 28 |e instan|tiated (|
|00004080| 77 69 74 68 20 70 6f 73 | 73 69 62 6c 65 0d 0a 61 |with pos|sible..a|
|00004090| 64 64 69 74 69 6f 6e 61 | 6c 20 74 72 61 6e 73 66 |dditiona|l transf|
|000040a0| 6f 72 6d 69 6e 67 20 61 | 6e 64 20 74 65 78 74 75 |orming a|nd textu|
|000040b0| 72 69 6e 67 29 20 76 69 | 61 20 74 68 65 20 7b 5c |ring) vi|a the {\|
|000040c0| 74 74 20 6f 62 6a 65 63 | 74 7d 20 6b 65 79 77 6f |tt objec|t} keywo|
|000040d0| 72 64 3a 0d 0a 0d 0a 5c | 62 65 67 69 6e 7b 64 65 |rd:....\|begin{de|
|000040e0| 66 6b 65 79 7d 7b 6f 62 | 6a 65 63 74 7d 7b 7b 5c |fkey}{ob|ject}{{\|
|000040f0| 65 6d 20 6f 62 6a 6e 61 | 6d 65 7d 20 5b 24 3c 24 |em objna|me} [$<$|
|00004100| 54 72 61 6e 73 66 6f 72 | 6d 61 74 69 6f 6e 73 24 |Transfor|mations$|
|00004110| 3e 24 5d 20 5b 24 3c 24 | 54 65 78 74 75 72 65 73 |>$] [$<$|Textures|
|00004120| 24 3e 24 5d 7d 0d 0a 09 | 49 6e 73 74 61 6e 74 69 |$>$]}...|Instanti|
|00004130| 61 74 65 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ate a co|py of th|
|00004140| 65 20 6f 62 6a 65 63 74 | 20 61 73 73 6f 63 69 61 |e object| associa|
|00004150| 74 65 64 20 77 69 74 68 | 20 7b 5c 65 6d 20 6f 62 |ted with| {\em ob|
|00004160| 6a 6e 61 6d 65 7d 2e 0d | 0a 09 49 66 20 67 69 76 |jname}..|..If giv|
|00004170| 65 6e 2c 20 74 68 65 20 | 74 72 61 6e 73 66 6f 72 |en, the |transfor|
|00004180| 6d 61 74 69 6f 6e 73 20 | 61 6e 64 20 74 65 78 74 |mations |and text|
|00004190| 75 72 65 73 20 61 72 65 | 20 63 6f 6d 70 6f 73 65 |ures are| compose|
|000041a0| 64 0d 0a 09 77 69 74 68 | 20 61 6e 79 20 61 6c 72 |d...with| any alr|
|000041b0| 65 61 64 79 20 61 73 73 | 6f 63 69 61 74 65 64 20 |eady ass|ociated |
|000041c0| 77 69 74 68 0d 0a 09 74 | 68 65 20 6f 62 6a 65 63 |with...t|he objec|
|000041d0| 74 20 62 65 69 6e 67 20 | 69 6e 73 74 61 6e 74 69 |t being |instanti|
|000041e0| 61 74 65 64 2e 0d 0a 5c | 65 6e 64 7b 64 65 66 6b |ated...\|end{defk|
|000041f0| 65 79 7d 0d 0a | |ey}.. | |
+--------+-------------------------+-------------------------+--------+--------+